As I said, a very more elegant solution!
Thank you!
On Mon, 01 May 2006 11:52:44 -0500, Prof Brian Ripley
<[EMAIL PROTECTED]> wrote:
> my_df[rep(1:nrow(my_df), times=n), ]
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
__
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, Ken
On Mon, 1 May 2006, Kenneth Cabrera 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?
Perhaps
my_df[rep(1:nrow(my_df), times=n), ]
is what you want?
--
Brian D. Ripley,
Sorry, I give a wrong answer. X
On 5/1/06, Xiaohua Dai <[EMAIL PROTECTED]> wrote:
>
> Maybe the function "merge" is what you need. Xiaohua
>
>
> On 5/1/06, Kenneth Cabrera <[EMAIL PROTECTED]> wrote:
> >
> > Hi R list:
> >
> > How can I "repeat" a data frame n times (with n>1000),
> > and obtain a
Maybe the function "merge" is what you need. Xiaohua
On 5/1/06, Kenneth Cabrera <[EMAIL PROTECTED]> 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
>
> Kenne
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/
__