Re: [R] simple data.frame question

2012-05-16 Thread arun
Hi Troels, Not sure this is what you want. > X<-runif(9,0,10) > FF1<-data.frame(ID=c(1,2,3)[rep(c(1,1,1,2,2,2,3,3,3))], > PERIOD=c(1,2,3)[rep(c(1,2,3),times=3)],X=X) > FF1$X[4]<-NA > FF1   ID PERIOD  X 1  1  1 8.27119347 2  1  2 9.64698097 3  1  3 2.74132386 4  2  1  

Re: [R] simple data.frame question

2012-05-16 Thread Troels Ring
Thanks a lot - beautiful Troels Den 16-05-2012 19:29, David Winsemius skrev: On May 16, 2012, at 11:56 AM, Troels Ring wrote: Dear friends - I hope you will forgive me another simple question, illustrated by ID <- c(1,1,1,2,2,3,3,3) PERIOD <- c(1,2,3,2,3,1,2,3) X <- runif(8,0,10)) Extrane

Re: [R] simple data.frame question

2012-05-16 Thread David Winsemius
On May 16, 2012, at 11:56 AM, Troels Ring wrote: Dear friends - I hope you will forgive me another simple question, illustrated by ID <- c(1,1,1,2,2,3,3,3) PERIOD <- c(1,2,3,2,3,1,2,3) X <- runif(8,0,10)) Extraneous paren removed: FF <- data.frame(ID=ID,PERIOD=PERIOD,X=X) I need to the

Re: [R] simple data.frame question

2007-10-23 Thread jim holtman
Your first statement may create a data frame, but your second statement now store a vector in an object with the same name, but is now not a data frame, that is why it "appears" that the first row is overwritten. What are you trying to do? On 10/23/07, pharos <[EMAIL PROTECTED]> wrote: > > Hi, >