Create a correlation matrix for all quantitative variables in a data frame.
cor_plot(
data,
method = c("pearson", "kendall", "spearman"),
sort = FALSE,
axis_text_size = 12,
number_text_size = 3,
legend = FALSE
)
data frame
a character string indicating which correlation coefficient is to be computed. One of "pearson" (default), "kendall", or "spearman".
logical. If TRUE
, reorder variables to place variables
with similar correlation patterns together.
size for axis labels (default=12).
size for correlation coefficient labels (default=3).
logical, if TRUE the legend is displayed. (default=FALSE)
a ggplot graph
The cor_plot
function will only select quantitative variables from
a data frame. Categorical variables are ignored.
The correlation matrix is presented as a lower triangle matrix.
Missing values are deleted in listwise fashion.
This function is a wrapper for the ggcorrplot
function.
cor_plot(cars74)
cor_plot(cars74, sort=TRUE)