Re: [R] replicate data.frame n times

2011-10-11 Thread David Winsemius
On Oct 11, 2011, at 4:22 PM, Bert Gunter wrote: Replicate the row indices? x[rep(seq_len(nrow(x)), k), ] Or the column indices. x[ , rep(seq_len(length(x)), k) ] -- David, -- Bert On Tue, Oct 11, 2011 at 12:55 PM, Martin Batholdy wrote: Hi, is there a way to replicate a data.frame

Re: [R] replicate data.frame n times

2011-10-11 Thread Bert Gunter
Replicate the row indices? x[rep(seq_len(nrow(x)), k), ] -- Bert On Tue, Oct 11, 2011 at 12:55 PM, Martin Batholdy wrote: > Hi, > > > is there a way to replicate a data.frame like you can replicate the entries > of a vector (with the repeat-function)? > > I want to do this: > > x <- data.frame(

[R] replicate data.frame n times

2011-10-11 Thread Martin Batholdy
Hi, is there a way to replicate a data.frame like you can replicate the entries of a vector (with the repeat-function)? I want to do this: x <- data.frame(x, x) (where x is a data.frame). but n times. And it should be as cpu / memory efficient as possible, since n is pretty big in my cas