Re: [R] Repeat dataframe

From: Kenneth Cabrera <krcabrer_at_epm.net.co>
Date: Tue 02 May 2006 - 02:46:12 EST

Well, I find a solution!

If DFe is a data frame and n is an integer then

DFr<-data.frame(t(matrix(rep(t(DFe),n),dim(DFe)[2],dim(DFe)[1]*n))) names(DFr)<-names(DFe)

Will work!!

Maybe somebody has a more elegant solution.

Again, thank you for your help.

On Mon, 01 May 2006 11:23:14 -0500, Kenneth Cabrera <krcabrer@epm.net.co> wrote:

> Hi R list:
>
> How can I "repeat" a data frame n times (with n>1000),
> and obtain a new data frame where all the n data frames
> are binded by rows?
>
> Thank you for your help
>
> Kenneth
>

-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Tue May 02 03:01:27 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 02 May 2006 - 04:10:01 EST.

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