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.
Export .csv files with readr - R Tutorial
From the course: Learning the R Tidyverse
Export .csv files with readr
- [Instructor] Readr is a member of the tidyverse ecosystem and designed for importing and exporting data to a variety of what we call flat file formats. These include comma separated value files which have the file extension CSV and tab separated files which have the extension TSV. There are a number of advantages to using readr over the base R functions for writing CSV files, namely write_csv is significantly faster than a base R equivalent. Readr will always preconvert factors to characters before exporting ensuring your exported data files will work outside of R. Also, write_CSV allows data to be appended to existing files provided column names are consistent, so let's look at some examples for how to do this inside of our exercise files. So, our exercise files contain two folders, data and data-raw. Inside of data we have one file which is called time-periods.csv which we're going to append some additional data to and if we go up one level into data-raw we have a file called…
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)
-
-
-
-