[R] binding two lists of lists of dataframes together
newrnewbie at hotmail.com
Mon May 11 23:07:02 CEST 2015
> From: newrnewbie at hotmail.com
> To: r-help at r-project.org
> Date: Mon, 11 May 2015 20:16:40 +0000
> Subject: [R] binding two lists of lists of dataframes together
> I'm new to R and am stumped. I'm trying to bind List 1 to List 2 and have the corresponding Output.
> I've found the following code - I can't say I understand rbindlist(lapply(list12, "[", i, TRUE)). Either way - it doesn't give exactly what's needed.
> list12 <- list(List1,List2)
> nr <- as.vector(nrow(list12[]))
> fastbind.ith.rows <- function(i) rbindlist(lapply(list12, "[", i, TRUE))
> fastbound <- lapply(1:nr, fastbind.ith.rows)
> It produces Output 2 - where dataframes are grouped together by rownames, but keeps 2 separate vectors - vs. binding the two into 1 vector.
> Any help/guidance would be greatly appreciated!!
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 55729 bytes
Desc: not available
More information about the R-help