ABSTRACT

This chapter looks at some different structures for storing data, before a longer discussion on data frames. It discusses several means to implement the “split-apply-combine” process to summarize a data set and about some basics of importing and exporting data. Data frames provide convenience for many things, but at times a matrix is more desirable. Having to type the data frame name 6 times is a bit too much, even if it was shortened from mtcars. Some typing could be saved by using intermediate variables, but there is a conceptual clarity in expressing this task all at once which can have value. To convert from “wide” data to “long” data using reshape requires a specification of which variables are to be combined into a single variable. Data sets of all varieties are to be found on the Internet. Many sites provide data in some regular format, though the formats can vary widely.