plot_correlation: Plot the correlation matrix for the provided layercodes

View source: R/stats.R

plot_correlationR Documentation

Plot the correlation matrix for the provided layercodes

Description

#' plot_correlation creates a plot of the correlation between different layers

Usage

plot_correlation(layers_correlation, prettynames = list(),
  palette = c("#2c7bb6", "#abd9e9", "#ffffbf", "#fdae61", "#d7191c"))

Arguments

layers_correlation

matrix or dataframe. A square matrix with the layers correlations you want to plot as returned by layers_correlation or pearson_correlation_matrix.

prettynames

list. Optional list with as names the layercodes and as values the name of the layer to be used in the plot.

palette

character vector. optional vector with 5 entries for the range of colors to be used for the correlation matrix plot.

Details

This function requires ggplot2 and plots the correlations for the layers in the same order as the layercodes are provided to this function.

Value

A ggplot object that can be printed or saved.

See Also

layers_correlation pearson_correlation_matrix list_layers layer_stats correlation_groups

Examples

correlation <- layers_correlation(c("BO_calcite", "BO_damin", "MS_bathy_5m"))
p <- plot_correlation(correlation)
print(p)


sdmpredictors documentation built on Aug. 23, 2023, 5:07 p.m.