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

Export .csv files with readr - R Tutorial

From the course: Learning the R Tidyverse

Start my 1-month free trial

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…

Contents