3 Importing & Exporting

There are various ways to import and export files, but the tidyverse includes the readr package. This imports data as tibbles. readxl can be used to import Excel files, and haven can import SAS/SPSS files.

You can check whether a object is a tibble dataframe using the function is.tibble() Nb. Columns containing characters are automatically given the character data type.

3.1 Importing with Base R

Base R import functions can import delimited files as dataframes.

You can check whether a object is a dataframe using the function is.data.frame() Nb. Columns containing characters are automatically given the factor data type.