Video není dostupné.
Omlouváme se.
What's the difference between a matrix, data frame, and tibble in R? (CC180)
Vložit
- čas přidán 18. 08. 2024
- 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....
The data were generated in our Kozich et al. 2013 paper (doi.org/10.1128...) using samples from the Schloss et al. 2012 paper (doi.org/10.4161....
#baseR #tibbles #Rstats
Want more practice on the concepts covered in Code Club? You can sign up for my weekly newsletter at shop.riffomona... 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...
You can also find complete tutorials for learning R with the tidyverse using...
Microbial ecology data: www.riffomonas...
General data: www.riffomonas...
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
Awesome video! Just jumped into R recently, and these concepts have been stumping me (tidyverse vs. base R). But feeling more confident now!
Wonderful!
Another great video. Thank you Pat.
Glad you all are enjoying this series 😍 thanks for watching!
Thanks for another great video!
My pleasure - thanks for tuning in! 🤩
I’ve only ever used base r but I want to learn tidyverse so I’m looking forward to the transition videos!
Fantastic- thanks for watching!
this video is great
Great! I thought of tibbles as dataframes, but with a cuter name. Now I see they are better when wanting to inspect them. Thanks
Wonderful - thanks for watching! ☺️
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
Lol I think you might be happier sticking with $ and using the data argument 😊
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.
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 🙃
@@Riffomonas I agree but it's good to know that you can use cbind to avoid converting your vector into a tibble first.
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.
Have you tried using the width argument with print to get more columns?
Didn't know that was an option but I'll check it out. Thanks.
y r u in a rush???
I didn't understand any thing
Sorry! If there's anything specific let me know what was confusing