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

From: milton ruser <milton.ruser_at_gmail.com>
Date: Fri, 25 Jul 2008 11:50:43 -0300

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, naw3_at_duke.edu <naw3_at_duke.edu> wrote:
>
> 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
>
> ______________________________________________
> 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.
>

        [[alternative HTML version deleted]]



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 Jul 2008 - 14:55:33 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 Jul 2008 - 15:02:24 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