I have a foreach loop that returns a list of lists. Each sub-list is a list of 3 data frames and I want to rbind them into 3 different data frames. Right now I am doing it like this:
x_final=data.frame
y_final=data.frame()
z_final=data.frame()
for(i in 1:length(big_list))
{
x=big_list[[i]][1]
y=big_list[[i]][2]
z=big_list[[i]][3]
x_final=rbind(x_final,x)
y_final=rbind(y_final,y)
z_final=rbind(z_final,z)
}
The problem is when length of big_list is large this loop takes a lot of time. Is there any other way of doing it faster? Any sort of help would be highly appreciated.