cor_plot {qacBase} | R Documentation |
Correlation matrix plot
Description
Create a correlation matrix for all quantitative variables in a data frame.
Usage
cor_plot(
data,
method = c("pearson", "kendall", "spearman"),
sort = FALSE,
axis_text_size = 12,
number_text_size = 3,
legend = FALSE
)
Arguments
data |
data frame |
method |
a character string indicating which correlation coefficient is to be computed. One of "pearson" (default), "kendall", or "spearman". |
sort |
logical. If |
axis_text_size |
size for axis labels (default=12). |
number_text_size |
size for correlation coefficient labels (default=3). |
legend |
logical, if TRUE the legend is displayed. (default=FALSE) |
Details
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.
Value
a ggplot graph
Note
This function is a wrapper for the ggcorrplot
function.
Examples
cor_plot(cars74)
cor_plot(cars74, sort=TRUE)