[R] Newbie: Subsets of data frame
Morten Sickel
Morten.Sickel at nrpa.no
Mon Sep 23 16:58:43 CEST 2002
I feel a bit embarassed by this, but I have not managed to find out how:
I have a data frame containing measurements over time for a number of
different locations:
> str(milk)
`data.frame': 845 obs. of 3 variables:
$ date : num 1987 1987 1987 1987 1987 ...
$ value : num 5 1 2 5 1 1 2 3 2 4 ...
$ location: Factor w/ 36 levels "Alta","Andøy",..: 1 1 1 1 1 1 1 1 1 1 ...
I assume there is some simpe way of extracting subsets of the data frame for
analysing the time series for just one of the location, but how? I have
tried using various variants of extract, [] and subset, but obiously, I have
missed something, for I have not managed to get out what I want.
--
Morten Sickel
Norwegian Radiation Protection Authority
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list