#' Compute correlation coefficients for quantiles
#'
#' Computes correlation coefficients of the quantiles.
#'
#' This is a way to quantify the similarity between statistical distributions.
#'
#' @param df A data frame
#' @param method Defults to "pearson". Can also be "kendall", "spearman".
#' @export
corOfQuantiles <- function(df, method = "pearson") {
for( i in 1:ncol(df)){
df[,i] <- df[,i][order(df[,i])] # orders observations to get the quantiles
}
return(cor(df, method = method))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.