This question covers the case where I have a list of columns, and I wish to turn them into a data.frame. What if I have a list of rows, and I wish to turn them into a data.frame?
rowList <- lapply(1:500000,function(x) sample(0:1,300,x))
The naive way to solve this is using rbind
and as.data.frame
, but we can't even get past the rbind
step:
>Data <- do.call(rbind,vectorList)
Error: cannot allocate vector of size 572.2 Mb
What is a more efficient to do this?