#' Flattens Correlation Matrix to table with columns row, column and cor
#' @param cormat correlation matrix with row- and colnames as produced by cor() function
#' @return data.frame with columns row, column and cor
#' @export
flattenCorrMatrix <- function(cormat) {
ut <- upper.tri(cormat)
data.table(
row = rownames(cormat)[row(cormat)[ut]],
column = rownames(cormat)[col(cormat)[ut]],
cor = (cormat)[ut]
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.