I need to make a data frame out of the data that I currently have in a list. This works, but is ugly: ineffData<-rbind(ineffFilesList[[1]], ineffFilesList[[2]], ineffFilesList[[3]], ineffFilesList[[4]], ineffFilesList[[5]], ineffFilesList[[6]], ineffFilesList[[7]], ineffFilesList[[8]], ineffFilesList[[9]], ineffFilesList[[10]], ineffFilesList[[11]], ineffFilesList[[12]], ineffFilesList[[13]], ineffFilesList[[14]], ineffFilesList[[15]], ineffFilesList[[16]], ineffFilesList[[17]], ineffFilesList[[18]], ineffFilesList[[19]], ineffFilesList[[20]], ineffFilesList[[21]], ineffFilesList[[22]], ineffFilesList[[23]], ineffFilesList[[24]], ineffFilesList[[25]], ineffFilesList[[26]], ineffFilesList[[27]]) What's an efficient way of doing this such that the computer will do the work of recurring through the list of elements of ineffFilesList? Much appreciation, Frank Tamborello, PhD W. M. Keck Postdoctoral Fellow School of Biomedical Informatics University of Texas Health Science Center at Houston
Hi Franklin, Try do.call(rbind, ineffFilesList) See ?do.call for more details. HTH, Jorge On Sun, Apr 10, 2011 at 2:01 PM, Franklin Tamborello II <> wrote:> I need to make a data frame out of the data that I currently have in a > list. This works, but is ugly: > ineffData<-rbind(ineffFilesList[[1]], ineffFilesList[[2]], > ineffFilesList[[3]], ineffFilesList[[4]], ineffFilesList[[5]], > ineffFilesList[[6]], ineffFilesList[[7]], ineffFilesList[[8]], > ineffFilesList[[9]], ineffFilesList[[10]], ineffFilesList[[11]], > ineffFilesList[[12]], ineffFilesList[[13]], ineffFilesList[[14]], > ineffFilesList[[15]], ineffFilesList[[16]], ineffFilesList[[17]], > ineffFilesList[[18]], ineffFilesList[[19]], ineffFilesList[[20]], > ineffFilesList[[21]], ineffFilesList[[22]], ineffFilesList[[23]], > ineffFilesList[[24]], ineffFilesList[[25]], ineffFilesList[[26]], > ineffFilesList[[27]]) > > > What's an efficient way of doing this such that the computer will do the > work of recurring through the list of elements of ineffFilesList? > > Much appreciation, > > > > > Frank Tamborello, PhD > W. M. Keck Postdoctoral Fellow > School of Biomedical Informatics > University of Texas Health Science Center at Houston > > ______________________________________________ > R-help@r-project.org 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. >[[alternative HTML version deleted]]
On Sun, Apr 10, 2011 at 06:01:39PM +0000, Franklin Tamborello II wrote:> I need to make a data frame out of the data that I currently have in > a list. This works, but is ugly: > ineffData<-rbind(ineffFilesList[[1]], ineffFilesList[[2]], > ineffFilesList[[3]], ineffFilesList[[4]], ineffFilesList[[5]], > ineffFilesList[[6]], ineffFilesList[[7]], ineffFilesList[[8]], > ineffFilesList[[9]], ineffFilesList[[10]], ineffFilesList[[11]], > ineffFilesList[[12]], ineffFilesList[[13]], ineffFilesList[[14]], > ineffFilesList[[15]], ineffFilesList[[16]], ineffFilesList[[17]], > ineffFilesList[[18]], ineffFilesList[[19]], ineffFilesList[[20]], > ineffFilesList[[21]], ineffFilesList[[22]], ineffFilesList[[23]], > ineffFilesList[[24]], ineffFilesList[[25]], ineffFilesList[[26]], > ineffFilesList[[27]]) > > > What's an efficient way of doing this such that the computer will do > the work of recurring through the list of elements of > ineffFilesList?as.data.frame(ineffFilesList) cu Philipp -- Dr. Philipp Pagel Lehrstuhl f?r Genomorientierte Bioinformatik Technische Universit?t M?nchen Wissenschaftszentrum Weihenstephan Maximus-von-Imhof-Forum 3 85354 Freising, Germany http://webclu.bio.wzw.tum.de/~pagel/