## some useful functions
#' converts a names list of vectors of different length to a matrix
#' (data.frame) with names (now duplicated) and list elements in
#' columns 1 and 2.
#' @param x a named list of vectors
#' @export
list2df <- function(x) {
strg <- paste0("__",paste0(sample(letters,5), collapse=""))
names(x) <- paste0(names(x), strg)
xa <- unlist(x)
## remove the numbered names generated by unlist
## and bind to data.frame
xa <- data.frame(names=sub(paste0(strg,"[0-9]*$"),"",names(xa)),
vectors=xa)
rownames(xa) <- NULL
xa
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.