September 2017
Beginner to intermediate
560 pages
25h 18m
English
Download the files for this chapter and store the auto-mpg.csv, employees.csv, and departments.csv files in your R working directory. Read the data and create factors for cylinders in auto-mpg.csv:
> auto <- read.csv("auto-mpg.csv", stringsAsFactors=FALSE)
> auto$cylinders <- factor(auto$cylinders, levels = c(3,4,5,6,8), labels = c("3cyl", "4cyl", "5cyl", "6cyl", "8cyl"))
Install the data.table package in your R environment, as follows:
> install.packages("data.table")
> library(data.table)
> autoDT <- data.table(auto)
Read now
Unlock full access