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
- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of 2k3autococker > Sent: Friday, 12 September 2008 3:57 p.m. > To: r-help@r-project.org > Subject: [R] Creating data frame from existing data frame > > > I'm new to R, using it for an engineering stats cla

[R] Creating data frame from existing data frame

2008-09-11 Thread 2k3autococker
I'm new to R, using it for an engineering stats class, and the first project is focused on creating data frames and plotting graphs. So far I have imported a set of data from a text file and saved it as a variable (using the read.table() function). One of the columns of the data consists of years,