6.1 Loading datasets
look at read_
set of functions
heights = read_csv('data/heights.csv')
## Parsed with column specification:
## cols(
## earn = col_double(),
## height = col_double(),
## sex = col_character(),
## ed = col_integer(),
## age = col_integer(),
## race = col_character()
## )
- skip number of rows
- comments can be skipped
- col_names for no column names
- manually pass in column names
- na specifies what is “missing”
in base R, read_csv
, data.table::fread()
string as factors! useing readr
compared to base R