From the course: Learning the R Tidyverse
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Separating columns into multiple columns - R Tutorial
From the course: Learning the R Tidyverse
Separating columns into multiple columns
- [Instructor] Dplyr is a member of the tidyverse ecosystem designed for manipulating data with a variety of different verbs. Separate is a very useful verb for splitting columns that contain multiple pieces of information into distinct columns. For instance, you may have data where locations are stored as a string with the name of the country, a comma and then the name of a city. This is actually two pieces of data that would be great to be able to split into separate columns. Separate is flexible enough to handle complicated cases where the deliminator appears multiple times in a string. Let's look at some examples of that in our exercise files. So, in our exercise files, we have two folders, we have data and data-raw. Let's have a look at data. It's currently empty. Data-raw, that has an Excel file in it and a file called data-tidying.R. Let's open it up and see what we have. I'm not going to be playing with my environment very much, so I'm going to minimize that and I also no…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Separate raw and clean data folders2m 48s
-
(Locked)
Import .xlsx files with readxl in R12m 19s
-
(Locked)
Import .csv files with readr into R5m 38s
-
(Locked)
Is it a data frame or a tibble?10m 43s
-
(Locked)
Select and filter data9m 32s
-
(Locked)
Convert strings to dates with mutate6m 40s
-
(Locked)
Separating columns into multiple columns6m 36s
-
(Locked)
Filter out NA values3m 35s
-
(Locked)
Export .csv files with readr5m 6s
-
(Locked)
Export .rdata objects for later4m 51s
-
(Locked)
-
-
-
-