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

From: Mark Brewster <markbbrewster_at_gmail.com>
Date: Fri, 25 Mar 2011 10:04:54 -0700 (PDT)

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-rows-into-a-pre-existing-data-frame-tp864111p3405898.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Fri 25 Mar 2011 - 19:07:04 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 25 Mar 2011 - 19:10:23 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive