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

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

Also, modified from Prof Brian Ripley's post 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:
Sent from the R help mailing list archive at

______________________________________________ mailing list
PLEASE do read the posting guide
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 Please read the posting guide before posting to the list.

list of date sections of archive