Learn R Programming

visdat (version 0.6.0)

data-vis-cor: Return data used to create vis_cor plot

Description

Return data used to create vis_cor plot

Create a tidy dataframe of correlations suitable for plotting

Usage

data_vis_cor(x, ...)

# S3 method for default data_vis_cor(x, ...)

# S3 method for data.frame data_vis_cor( x, cor_method = "pearson", na_action = "pairwise.complete.obs", ... )

# S3 method for grouped_df data_vis_cor(x, ...)

Value

data frame

tidy dataframe of correlations

Arguments

x

data.frame

...

extra arguments (currently unused)

cor_method

correlation method to use, from cor: "a character string indicating which correlation coefficient (or covariance) is to be computed. One of "pearson" (default), "kendall", or "spearman": can be abbreviated."

na_action

The method for computing covariances when there are missing values present. This can be "everything", "all.obs", "complete.obs", "na.or.complete", or "pairwise.complete.obs" (default). This option is taken from the cor function argument use.

Examples

Run this code
data_vis_cor(airquality)

if (FALSE) {
#return vis_dat data for each group
library(dplyr)
airquality %>%
  group_by(Month) %>%
  data_vis_cor()
}
data_vis_cor(airquality)

Run the code above in your browser using DataLab