What's the difference between a matrix, data frame, and tibble in R? (CC180)

  Рет қаралды 6,545

Riffomonas Project

Riffomonas Project

Күн бұрын

Do you know when to use a matrix, data frame, or tibble in R? Do you know how to use each or even what the differences are between these three types of variables? In this episode of Code Club, Pat will show you how to convert the same data between the different types using base R functions. Finally, he'll bring back the tidyverse to show why he prefers to work with data frames as tibbles. 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 www.riffomonas.org/code_club/....
The data were generated in our Kozich et al. 2013 paper (doi.org/10.1128/AEM.01043-13) using samples from the Schloss et al. 2012 paper (doi.org/10.4161/gmic.21008).
#baseR #tibbles #Rstats
Want more practice on the concepts covered in Code Club? You can sign up for my weekly newsletter at 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 riffomonas.org/workshops/
You can also find complete tutorials for learning R with the tidyverse using...
Microbial ecology data: www.riffomonas.org/minimalR/
General data: www.riffomonas.org/generalR/
0:00 Matrices, data frames, and tibbles what's the difference?
0:50 Working with R's matrix variables
2:26 Working with R's distance matrix variables
4:55 Working with R's data frame variables
13:16 Working with R/tidyverse's tibble variables

Пікірлер: 22
@xxXXCarbon6XXxx
@xxXXCarbon6XXxx 2 жыл бұрын
Great! I thought of tibbles as dataframes, but with a cuter name. Now I see they are better when wanting to inspect them. Thanks
@Riffomonas
@Riffomonas 2 жыл бұрын
Wonderful - thanks for watching! ☺️
@caseyj1144
@caseyj1144 2 жыл бұрын
I’ve only ever used base r but I want to learn tidyverse so I’m looking forward to the transition videos!
@Riffomonas
@Riffomonas 2 жыл бұрын
Fantastic- thanks for watching!
@TheMaplestoryGuide
@TheMaplestoryGuide 2 жыл бұрын
Awesome video! Just jumped into R recently, and these concepts have been stumping me (tidyverse vs. base R). But feeling more confident now!
@Riffomonas
@Riffomonas 2 жыл бұрын
Wonderful!
@dasrotrad
@dasrotrad 2 жыл бұрын
Another great video. Thank you Pat.
@Riffomonas
@Riffomonas 2 жыл бұрын
Glad you all are enjoying this series 😍 thanks for watching!
@dgoodall6468
@dgoodall6468 2 жыл бұрын
Thanks for another great video!
@Riffomonas
@Riffomonas 2 жыл бұрын
My pleasure - thanks for tuning in! 🤩
@julioramos4113
@julioramos4113 Жыл бұрын
this video is great
@javierhernando5063
@javierhernando5063 2 жыл бұрын
Great video! Really helpful. I've been waiting for stuff like this long time. My problems usually come from tibble format with base syntax e. g. t.test(x=subset(dat, group== "A")[,v[4]], y=subset(dat, group== "B")[,v[4]], paired = F)$p.value I would like to mix all the elements
@Riffomonas
@Riffomonas 2 жыл бұрын
Lol I think you might be happier sticking with $ and using the data argument 😊
@mikep8857
@mikep8857 2 жыл бұрын
Great video. I didn't know that you can bind a vector and a data frame using cbind. I tend to use bind_cols from the tidyverse which is less forgiving.
@Riffomonas
@Riffomonas 2 жыл бұрын
I hear you on the “less forgiving” part but I think tidyverse has a lot of that stuff to protect us from doing silly things we aren’t anticipating 🙃
@mikep8857
@mikep8857 2 жыл бұрын
@@Riffomonas I agree but it's good to know that you can use cbind to avoid converting your vector into a tibble first.
@RUJedi
@RUJedi 2 жыл бұрын
Tibbles drive me nuts since I'd rather see more of the columns than it fits in the console, so I stick to data frames most of the time.
@Riffomonas
@Riffomonas 2 жыл бұрын
Have you tried using the width argument with print to get more columns?
@RUJedi
@RUJedi 2 жыл бұрын
Didn't know that was an option but I'll check it out. Thanks.
@ahmad3823
@ahmad3823 11 ай бұрын
y r u in a rush???
@monzerthejoker343
@monzerthejoker343 23 сағат бұрын
I didn't understand any thing
@Riffomonas
@Riffomonas 3 сағат бұрын
Sorry! If there's anything specific let me know what was confusing
Using paths in R and why you shouldn't be using setwd (CC179)
15:14
Riffomonas Project
Рет қаралды 4,4 М.
The magrittr and base R pipe: what's the difference? (CC241)
25:47
Riffomonas Project
Рет қаралды 4,9 М.
Does size matter? BEACH EDITION
00:32
Mini Katana
Рет қаралды 18 МЛН
Мы никогда не были так напуганы!
00:15
Аришнев
Рет қаралды 6 МЛН
DEFINITELY NOT HAPPENING ON MY WATCH! 😒
00:12
Laro Benz
Рет қаралды 49 МЛН
когда повзрослела // EVA mash
00:40
EVA mash
Рет қаралды 4,6 МЛН
Using dplyr's group_by function with and without summarize (CC233)
25:54
Riffomonas Project
Рет қаралды 4,7 М.
tidyverse - tidy data - Tibble Tribble Data Frame - Differences? R!
8:29
Using the vegan R package to generate ecological distances (CC188)
17:37
Riffomonas Project
Рет қаралды 16 М.
27. All about Dataframes in R
23:36
Anand S
Рет қаралды 10 М.
Generative AI in a Nutshell - how to survive and thrive in the age of AI
17:57
Introduction to Tidyverse in R - dplyr
28:48
Quant Psych
Рет қаралды 6 М.
A tutorial for writing functions in R (CC177)
14:37
Riffomonas Project
Рет қаралды 14 М.
David Robinson - Ten Tremendous Tricks in the Tidyverse
20:41
Lander Analytics
Рет қаралды 29 М.
Сколько реально стоит ПК Величайшего?
0:37
iPhone socket cleaning #Fixit
0:30
Tamar DB (mt)
Рет қаралды 11 МЛН
Где флагманы с IPS?
0:52
Не шарю!
Рет қаралды 33 М.
Как правильно выключать звук на телефоне?
0:17
Люди.Идеи, общественная организация
Рет қаралды 1,2 МЛН
Игровой Комп с Авито за 4500р
1:00
ЖЕЛЕЗНЫЙ КОРОЛЬ
Рет қаралды 2,2 МЛН