
i
i
“K23166” — 2015/1/28 — 9:35 — page 11 — #37
i
i
i
i
i
i
Chapter 2
Data management
This chapter reviews important data management tasks, including dataset structure, de-
rived variables, and dataset manipulations. Along with functions available in base R, we
demonstrate additional functions from the dplyr, memisc, mosaic, and tidyr packages.
2.1 Structure and metadata
2.1.1 Access variables from a dataset
The standard object to store data in R is the dataframe (see A.4.6), a rectangular collection
of variables. Variables are generally stored as vectors. Variable references must contain the
name of the object, which includes the variable, with certain exceptions. ...