Description Usage Arguments Value Examples
Function to convert a list of dataframes to a 3D array All objects in the list will be dataframes with identical column headings. From Hannah Buckley (https://www.researchgate.net/publication/277670582_R_function_to_convert_a_list_of_dataframes_into_a_3-D_array)
1 | list2array(input.list)
|
input.list |
List of dataframes |
three dimensional array (rows) x (cols) x (dataframenumber in list)
1 2 3 4 5 | dat.ls <- vector("list",10) # empty list
for(i in 1:10) {
dat.ls[[i]] <- data.frame(xx=rnorm(25,3,2),yy=rnorm(25,2,1),zz=rnorm(25,2,1))
} # fill list
dat.ary <- list2array(dat.ls) # convert to ary
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.