Re: [R] applying rbind to list elements

2007-04-25 Thread Tony Plate
do.call("rbind", l)

or, in the case of matrices, using the abind package:

abind(l, along=1)

 > library(abind)
 > l <- list(matrix(1:6, ncol=2), matrix(11:14, ncol=2))
 > abind(l, along=1)
  [,1] [,2]
[1,]14
[2,]25
[3,]36
[4,]   11   13
[5,]   12   14
 >

Hendrik Fuß wrote:
> Hi,
> 
> I have a list of n data.frames (or matrices) which I would like to
> convert to a single data.frame using rbind:
> 
>x <- rbind( l[[1]], l[[2]], l[[3]], l[[4]], ..., l[[n]] )
> 
> Is there a simple way to do this?
> 
> thanks
> Hendrik
>

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] applying rbind to list elements

2007-04-25 Thread Hendrik Fuß
I knew there would be a simple solution.

thanks everybody.

On 25/04/07, Duncan Murdoch <[EMAIL PROTECTED]> wrote:
> On 4/25/2007 4:09 PM, Hendrik Fuß wrote:
> > Hi,
> >
> > I have a list of n data.frames (or matrices) which I would like to
> > convert to a single data.frame using rbind:
> >
> >x <- rbind( l[[1]], l[[2]], l[[3]], l[[4]], ..., l[[n]] )
> >
> > Is there a simple way to do this?
>
> do.call(rbind, l).
>
> Duncan Murdoch
>
>


-- 
Hendrik Fuß
PhD student
Systems Biology Research Group

University of Ulster, School of Biomedical Sciences
Cromore Road, Coleraine, BT52 1SA, Northern Ireland

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] applying rbind to list elements

2007-04-25 Thread Duncan Murdoch
On 4/25/2007 4:09 PM, Hendrik Fuß wrote:
> Hi,
> 
> I have a list of n data.frames (or matrices) which I would like to
> convert to a single data.frame using rbind:
> 
>x <- rbind( l[[1]], l[[2]], l[[3]], l[[4]], ..., l[[n]] )
> 
> Is there a simple way to do this?

do.call(rbind, l).

Duncan Murdoch

__
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
and provide commented, minimal, self-contained, reproducible code.


[R] applying rbind to list elements

2007-04-25 Thread Hendrik Fuß
Hi,

I have a list of n data.frames (or matrices) which I would like to
convert to a single data.frame using rbind:

   x <- rbind( l[[1]], l[[2]], l[[3]], l[[4]], ..., l[[n]] )

Is there a simple way to do this?

thanks
Hendrik

-- 
Hendrik Fuß
PhD student
Systems Biology Research Group

University of Ulster, School of Biomedical Sciences
Cromore Road, Coleraine, BT52 1SA, Northern Ireland

__
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
and provide commented, minimal, self-contained, reproducible code.