I have a huge data.I have tried to make an example but it is impossible because I have 10000 files and they are very huge. So i try to give what I need with the example below
Imagine I have a data like this
d1 <- data.frame(y1=c(1,2,3,5,7),y2=c(4,5,6))
d2 <- data.frame(y1=c(3,2,1),y2=c(6,5,4))
d3 <- data.frame(y1=c(3,2,1,5),y2=c(6,5,4,NA))
my.list <- list(d1, d2,d3)
I want to have a data frame like this
1 4 3 6 3 6
2 5 2 5 2 5
3 6 1 4 1 4
5 NA 5 NA
7 NA
I read this one What is the most efficient way to cast a list as a data frame? and as.data.frame flattens nested list into single row instead of creating row for each record and many other related post but I could not find a solution for it
I did
my.df <- do.call("cbind", lapply(my.list, data.frame))
error
Error in data.frame(..., check.names = FALSE) : arguments imply differing number of rows: 3, 4, 5
I do
do.call(cbind.data.frame, my.list)
error
Error in data.frame(..., check.names = FALSE) :
arguments imply differing number of rows: 3, 4, 5