corrmorant: Simple automated correlation plots

Description Usage Arguments Details See Also Examples

View source: R/corrmorant.R

Description

corrmorant() is a wrapper around ggcorrm() that creates scatterplot matrices with correlation output using reasonable standard values for initial data inspection.

Usage

1
2
3
4
5
6
7
8
9
corrmorant(
  data,
  style = c("blue_red", "dark", "light", "binned"),
  rescale = c("as_is", "by_sd", "by_range"),
  corr_method = c("pearson", "kendall", "spearman"),
  labels = NULL,
  bins = 10,
  ...
)

Arguments

data

For tidy_corrm.default, a data.frame or matrix with the raw data used for the correlation plot. If a data.frame, all numeric variables are used as rows/columns of the correlation plot, while all other variables are appended to the reshaped dataset as additional columns.

style

Character string defining the plot style. One of "dark", "light", "blue_red" or "binned".

rescale

character string specifying the type of transformation performed on the numeric variables in the plot. The standard argument as_is" uses the unchanged raw values."by.sd" scales by the standard deviation of the data and centers around zero. "by.range" rescales the range of the data to the interval from 0 to 1. Defaults to "as_is".

corr_method

character string with the correlation method passed to stats::cor(). Used for the .corr variable appended to the tidy_corr dataset and passed on to lotri_corrtext()/ utri_corrtext() layers. Can be one of "pearson", "kendall" and "spearman". Defaults to "pearson".

labels

(Optional) character vector or function. If a character, must contain labels for the names of all numeric columns that are used to replace the column names in the plot axis and text labels and must be of the same length as the number of numeric columns displayed in the plot. If a function, must take the original names of the numeric columns as an argument and return a character vector with the same length. Defaults to NULL (use original column names as labels).

bins

Integer. Number of bins for style = "binned" (ignored if using other styles). Defaults to 10.

...

Additional arguments to ggcorrm().

Details

corrmorant() is a simplified wrapper around ggcorrm() that creates scatterplot matrices with reasonable standard settings. Setting the style argument to "dark", "light" or "blue_red" produces regular scatterplots with different color schemes. style = "binned" replicates style = "blue_red" with a binned scatterplot (the number of bins defaults to 10, but can be changed with the bins argument), which can be very useful to reduce the plotting time for large datasets. Refer to the documentation of ggcorrm() and tidy_corrm() for more details.

See Also

ggcorrm, tidy_corrm

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
if(interactive()){
 # plot the drosera dataset with 3 different styles
 corrmorant(drosera, style = "dark")
 corrmorant(drosera, style = "light")
 corrmorant(drosera, style = "blue_red")
 }

## End(Not run)

r-link/corrmorant documentation built on Jan. 10, 2021, 7:26 p.m.