Open egilfeather opened 3 years ago
This won’t be on the test, but a list is a collection of objects, typically vectors matrices and data frames, but just about anything else including function definitions I think . Lists aren’t vectors but they follow some of the same logic as vectors and some cases IIRC can be operated on or created in a vectoredized fashion, though I prefer loops because they are more transparent
Many things in R are vectors, but everything in R is an object.
On Mon, Oct 4, 2021 at 9:06 PM egilfeather @.***> wrote:
What is the difference between shrooms_vector and shrooms_list? My understanding was that in R a vector and a list were the same thing.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/brouwern/compbio2021/issues/57, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB32NE5BPH4ITCZTUIBTGNDUFJFPTANCNFSM5FKTC7OQ .
--
Nathan L. Brouwer, PhD
@.***
Lecturer
Department of Biological Sciences https://www.biology.pitt.edu/
University of Pittsburgh
Biostatistics course: brouwern.github.io/BIOSC_1120/index.html
Research Associate
National Aviary, Dept. of Conservation & Field Research https://www.aviary.org/conservation
R code: github.com/brouwern
R tweets: @lobrowR https://twitter.com/lobrowR
I believe that the main and most important difference is that vectors are one dimensional can only carry one type of data, such as numeral or character, while lists are able to carry multiple. For example, the shrooms_vector carries only the sequence information, while the shrooms_list has the associated accession number for each sequence.
What is the difference between shrooms_vector and shrooms_list? My understanding was that in R a vector and a list were the same thing.
https://github.com/brouwern/compbio2021/blob/4fc22d26cd66119a177fd9572bd409ffa989216d/KEY-MSA-walkthrough-shroom.Rmd#L569-L570