[R] beginner data.frame question
kwythers at umn.edu
Wed Dec 24 00:29:56 CET 2008
I need some help understanding how on of the example data sets is
formatted in the basic R installation. If I load the Mona Loa CO2
data, with the command:
I can view the data with:
And the data are in the form of 11 rows labeled as years (1994-2004)
and 12 columns labeled (Jan - Dec). This structure appears to be a
dataframe, however, if I type the command
I get a time series with CO2 on the x axis and time on the y. Also,
> summary(co2) gives a single Min, Median, Max.
The reason for my confusion is that I created another "similar
looking" data set with read.table. In that case, the data looks to be
in same format (rows as years, and columns as months). However, the
gives a summary for each month. Completely different behavior.
If use the data.frame command:
I get a single column of CO2 data, while the data.frame command on my
test.data data, keeps it's year-row, column-month format.
Can anyone help me understand the differences in how these data sets
Thanks in advance.
More information about the R-help