R provides several packages to do data analysis and data manipulation. Over and above the
apply family of functions, the most commonly used packages are
data.table. In this recipe, we will cover
data.table, which processes large amounts of data very efficiently without our having to write detailed procedural code.
Download the files for this chapter and store the
departments.csv files in your R working directory. Read the data and create factors for
> auto <- read.csv("auto-mpg.csv", stringsAsFactors=FALSE) > auto$cylinders <- factor(auto$cylinders, levels = c(3,4,5,6,8), labels = c("3cyl", "4cyl", ...