Re: [R] Insert rows into a pre-existing data frame

2011-03-25 Thread Mark Brewster
Also, modified from Prof Brian Ripley's post https://stat.ethz.ch/pipermail/r-devel/2006-July/038551.html here , idx<- 2 df3<- df1[c(1:idx,idx,(idx+1):nrow(df1)),] df3 df3[idx+1,]<- NA #or whatever values you want df3 -- View this message in context: http://r.789695.n4.nabble.com/Insert-ro

Re: [R] Insert rows into a pre-existing data frame

2008-07-25 Thread milton ruser
Hi "somebody" I hope this helps: df1<-data.frame(cbind(va=runif(3), vb=runif(3))) df1 df2<-data.frame(cbind(va=runif(3), vb=runif(3))) df2 df.blank<-data.frame(cbind(va=NA, vb=NA)) df.blank df.join<-rbind(df1, df.blank, df2) df.join Miltinho astronauta brazil On 7/25/08, [EMAIL PROTECTED

[R] Insert rows into a pre-existing data frame

2008-07-25 Thread naw3
Hi, I'm sorry if this is a simple question. How do you insert a blank row into a data frame? I basically need to do this: old table: new table: C1 C2 C3 C1 C2 C3 1 32 34 1 32 34 2 52 23 54 2 52 23 _