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 - R Tutorial
From the course: Learning the R Tidyverse
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…
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)
-
-
-
-