Data is rarely entered directly into R. When we analyze data, getting data into R can either imply
importing data from some file or server (see Section 5.2), or
creating data from scratch (see Section 5.3).
Importing data and creating data frames or tibbles are two possible ways of getting data into R. In both cases, we end up with rectangular data structure known as a data frame or tibble (which a simplified type of data frame, used in the tidyverse (Wickham et al., 2019).
Key concepts of Section 5.2 on importing data include:
- working directory
- file paths (absolute vs. relative)
- importing vs. exporting/reading vs. writing files
Key concepts of Section 5.3 on creating tibbles include:
- rectangular data structures (with rows/cases and columns/variables)
- data frames vs. tibbles
Resources for Section 5.2 on importing data include:
The base R package utils and the tidyverse package readr (Wickham et al., 2018)
Resources for Section 5.3 on creating tibbles include: