Re: [R] Creating data frame from existing data frame

2008-09-12 Thread Dimitris Rizopoulos
well, first you could have a look at ?"[.data.frame" ?subset and then check the following: dat <- data.frame(year = sample(seq(2000, 2008, 2), 100, TRUE), y = rnorm(100)) subset(dat, year == 2002) dat[dat$year == 2002, ] # or subset(dat, year > 2002) dat[dat$year > 2002, ] I hope it helps.

Re: [R] Creating data frame from existing data frame

2008-09-11 Thread Peter Alspach
Josh You are wanting to subset the data so try help(subset) or ?subset. And follow the See also which refers to '['. You might also find the introductory manual helpful. Most of the contributed documentation on CRAN (the comprehensive R archive network) will cover this with examples. I found Pa