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.

Import .csv files with readr into R

Import .csv files with readr into R - R Tutorial

From the course: Learning the R Tidyverse

Start my 1-month free trial

Import .csv files with readr into R

- [Instructor] The readr package is a member of the tidyverse and provides excellent tools for importing and exporting data from so-called flat files. For instance, comma-separated value files which have the extension CSV and tab-separated files which have the extension TSV and generally, you can use the readr library to import any simple delimitated tabular plain text file. Now, there are Base R functions for importing CSV and other delimitated file formats but these have a number of well-known fiddly issues. For instance, automatically converting characters or strings into factors. Readr provides a much simpler, significantly faster for large data files and more automated approach to importing CSV files than Base R. Let's have a quick look at a comparison between using readr and Base R functions for importing CSV files. So, in our project, we have a folder called data and if we have a look inside that folder, we can see we have a CSV file. So, let's create a script file where we…

Contents