- data
A dataframe. If data is generated by get_cspp_data
function, the function can automatically parse the dataframe. Otherwise,
this function will attempt to make a correlation plot or matrix from all
numeric variables within the passed dataframe.
- vars
Default is NULL. If left NULL, uses all variables within the
passed dataframe. Otherwise, must be a character vector. The dataframe is
subset based on variables listed.
- summarize
Default is TRUE. If TRUE, and if the variable st
is present, the function will create state specific averages for each
variable in the dataframe. If FALSE, the function will generate the
correlation matrix and plot for all values in the dataset.
- labels
Default is TRUE. If TRUE, the correlation plot will include
labels for the correlation value. If FALSE, no labels will be present.
- label_size
Default is 3. Controls the size of the font for labels.
- colors
Specify the colors to be used in the correlation plot. Must
include three values in a character vector format. The default values are
`c("#6D9EC1", "#FFFFFF", "#E46726")`.
- cor_matrix
Default is FALSE. If set to TRUE, instead of returning a
ggplot object that is a correlation plot, returns a correlation matrix.
This is particularly useful if you want to customize the output with
ggcorrplot
.