R/visualize_correlation.R

Defines functions visualize_correlation

Documented in visualize_correlation

#' visualize correlations
#'
#' visualize_correlation
#'
#' @param df dataframe containing multiple multivariate time series formatted using
#' the specific Table Schema, use \code{showDF()} to display schema specification details.
#' @param method what type of plot should be drawn. Possible methods are:
#' \describe{
#'   \item{circle:}{for circle}
#'   \item{square:}{for square}
#'   \item{ellipse:}{for ellipse}
#'   \item{number:}{for number}
#'   \item{pie:}{for pie}
#'   \item{shade:}{for shade}
#'   \item{color:}{for color}
#' }
#'
#' @export
#'

visualize_correlation <- function(df, method="circle",...){

  correlations <- cor(df)
  table <- correlations
  plot <- corrplot::corrplot(correlations, method=method,...)
  out <- list(table, plot)
  return(out)
}
forvis/PdM documentation built on Dec. 5, 2020, 8:54 p.m.