A matrix in base R is vector of vectors where all of the data in the matrix is of the same type. This data structure has important uses for things like working with distance matrices, performing linear algebra, and other applications. If you understand how to work with R's vectors, working with a matrix in base R will be straightforward. This is part of a series of videos demonstrating how to functions from base R to make these data compatible with tools from the tidyverse
You can find my blog post for this episode at https://www.riffomonas.org/code_club/2021-12-16-matrices.
The data were generated in our Kozich et al. 2013 paper (http://doi.org/10.1128/AEM.01043-13) using samples from the Schloss et al. 2012 paper (http://doi.org/10.4161/gmic.21008).
#matrix #baseR #R #Rstats
Want more practice on the concepts covered in Code Club? You can sign up for my weekly newsletter at https://shop.riffomonas.org/youtube to get practice problems, tips, and insights.
If you're interested in taking an upcoming 3 day R workshop be sure to check out our schedule at https://riffomonas.org/workshops/
You can also find complete tutorials for learning R with the tidyverse using...
Microbial ecology data: https://www.riffomonas.org/minimalR/
General data: https://www.riffomonas.org/generalR/
0:00 Creating and accessing matrices
1:59 Creating a matrix
3:25 Accessing values in a matrix
5:32 Removing values from a matrix
6:16 Modifying values in a matrix
7:50 All of the values in a matrix are the same type
8:29 Initializing a matrix
9:17 Applying knowledge to create a distance matrix