5. Advanced Data Structures
Sometimes data require more complex storage than simple
vectors and thankfully
R provides a host of data structures. The most common are the
list, followed by the
array. Of these, the
data.frame will be most familiar to anyone who has used a spreadsheet, the
matrix to people familiar with matrix math and the
list to programmers.
Perhaps one of the most useful features of
R is the
data.frame. It is one of the most often cited reasons for
R’s ease of use.
On the surface a
data.frame is just like an Excel spreadsheet in that it has columns and rows. In statistical terms, each column is a variable and each row is an observation.
In terms of how
data.frames, each column ...