Lst2mat <- function(xlst, label = 'L1')
{
## Number of row and column
nr <- sapply(xlst,nrow)
nc <- ncol(xlst[[1]])
## allocate memory
ans <- matrix(NA, sum(nr),nc + 1)
## create a table of the row indices for each element of the list
cc <- cumsum(nr)
cid <- cbind(c(1, cc + 1), c(cc, 0))
## Copy data to matrix
for(ii in seq_along(xlst)){
ans[seq(cid[ii, 1], cid[ii, 2]), ] <- cbind(ii, as.matrix(xlst[[ii]]))
}
## copy names
colnames(ans) <- c(label, colnames(xlst[[1]]))
## return
ans
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.