MENU

Fun & Interesting

EasyR - Tidyverse 3: Using the "pipe" operator in R and transforming data from wide to long format.

Tony Carlsen 131 4 months ago
Video Not Working? Fix It Now

In this final installment looking at the tidyverse package in R, we will learn how to use the pipe operator function to "string" together commands and make our code more readable. In addition, we will learn to use the pivot_longer and pivot_wider() commands to transform datasets between "wide format" and "long format". Links to video sections and data files are in the description below. Data files used in this video: mindfulness.csv: https://www.mediafire.com/file_premium/dbsx5b6v066hj7v/mindfulness.csv/file RTs_wide.csv: https://www.mediafire.com/file_premium/x35iagsd2n0bx6k/RTs_wide.csv/file coreT_wide.csv: https://www.mediafire.com/file_premium/9x7x659raqjsn6s/coreT_wide.csv/file Sections: 00:00​ Intro, loading required packages and datasets 02:43 Why we want to use the pipe operator 13:52 Rearranging a dataset prior to analysis 16:32 Changing a dataset from long to wide format 23:00 Doing the same process using the pipe operator 28:32 Pivoting a dataset from wide to long format 40:00 Pivoting another dataset from wide to long format

Comment