#' Convert a matrix with rownames into an indexed data.frame
#'
#' @param mtx matrix with rownames
#'
#' @return data.frame with column "id" containing mtx's rownames
#' @export
mtx2idf <- function(mtx) {
stopifnot(is.matrix(mtx))
mtx %>%
as.data.frame() %>%
tibble::rownames_to_column("id")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.