Re: [R] convert list int data frame

2015-09-14 Thread Ivan Calandra
Hi Luigi, It depends on how you want to put the different elements of my.list into a data.frame. Basically, data.frames are lists, so doing data.frame(my.list) is straigthforward. HTH, Ivan -- Ivan Calandra, PhD University of Reims Champagne-Ardenne GEGENAA - EA 3795 CREA - 2 esplanade Roland

Re: [R] convert list int data frame

2015-09-14 Thread Sarah Goslee
You don't say how you want the new data frame (which incidentally is also a list) to be constructed, so here are two options: > my.list <- replicate(5, matrix(1:(6*27), ncol = 6, byrow = TRUE), FALSE) > dim(my.list[[1]]) [1] 27 6 > dim(do.call(rbind.data.frame, my.list)) [1] 135 6 > dim(do.call(

[R] convert list int data frame

2015-09-14 Thread Luigi Marongiu
Dear all, i would like to convert a list onto a data frame object. Is there an easy way of doing it? I know I should use unlist() but I am not sure about the implementation for the addition of the row numbers; or I could extract one member at the time with something like x <- my.list[[i]] but then