[R] Stacking a list of data.frames

Dimitris Rizopoulos dimitris.rizopoulos at med.kuleuven.be
Thu Sep 7 14:08:44 CEST 2006

try this:

do.call(cbind, l)


Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/(0)16/336899
Fax: +32/(0)16/337015
Web: http://med.kuleuven.be/biostat/

----- Original Message ----- 
From: "TAPO (Thomas Agersten Poulsen)" <TAPO at novozymes.com>
To: <r-help at stat.math.ethz.ch>
Sent: Thursday, September 07, 2006 1:56 PM
Subject: [R] Stacking a list of data.frames

Dear list,

I have a list of data.frames (generated by "by"), that I want to 
"stack" into a single data.frame.

I can do this by cbind, but only by subsetting the list explicitly 
like this:


I find this ugly and not very general.

I tried
but they do not give the right result.

Please help!

Best regards
Thomas A Poulsen        Scientist, Ph.D.
Novozymes A/S           Protein Design / Bioinformatics
Brudelysvej 26, 1US.24  Phone: +45 44 42 27 23
DK-2880 Bagsværd.       Fax:   +45 44 98 02 46

R-help at stat.math.ethz.ch mailing list
PLEASE do read the posting guide 
and provide commented, minimal, self-contained, reproducible code.

Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

More information about the R-help mailing list