Tidying data in R with pivot_wider()
HTML-код
- Опубликовано: 11 сен 2024
- Let's learn how to use the pivot_wider() command from R's {dplyr} package to deal with observations that are spread across multiple rows of a data frame. Your life is about to get better!
If this vid helps you, please help me a tiny bit by mashing that 'like' button. For more #rstats joy, crush that 'subscribe' button!
You can find materials from this vid (and others) at github.com/equitable-equations/youtube
Couldn't find the blocks dataset in the link?
@@TheJq32 It's included in the GLMsData package. The script on GitHub includes code to access the set. Enjoy!
I spent hours stuck on a question for an assignment. I was completely in tears, and made a desperate pilgrimage to RUclips... and learned exactly how to do the thing in 5 minutes. THANK YOU!!!
Yay! Glad it helped.
Very well explained without any clutter
This is a great video! Thank you very much !
This was hella useful
Thanks !!
Thank you a lot! I understood it perfectly
Thanks!
Thanks
Thank you!
Thank you so much for this helpful video!! May I ask: After having converted the blocks dataframe into wide format: If i wanted to calculate the mean for time and for number of trial 1 and trial 2, how would that work?
Hi! It's actually more natural to do those calculations before pivoting. Group_by() and summarize() are built for this!
ruclips.net/video/owkZgyeNXSg/видео.html
Thanks for this video.
Glad it helped!
Pivot_wider and _longer are in the tidyr package, not dplyr.
Thanks, Andrew. It would be more helpful if you can attach the data you used.
Done.
@@EquitableEquations Many thanks.
Thanks
You're welcome!