Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

show_correlation

Show correlation


Description

Show correlation

Usage

show_correlation(
  data,
  method = "pearson",
  diag = TRUE,
  labels = FALSE,
  vjust = 0,
  text_size = 15
)

Arguments

data

Tibble with results of as returned by the landscapemetrics package.

method

Type of correlation. See link{cor} for details.

diag

If FALSE, values on the diagonal will be NA and not plotted.

labels

If TRUE, the correlation value will be added as text.

vjust

Will be passed on to ggplot2 as vertical justification of x-axis text.

text_size

Text size of the plot.

Details

The functions calculates the correlation between all metrics. In order to calculate correlations, for the landscape level more than one landscape needs to be present. All input must be structured as returned by the landscapemetrics package.

Value

ggplot

Examples

metrics <- calculate_lsm(landscape, what = c("patch", "class"))
show_correlation(data = metrics, method = "pearson")

## Not run: 
metrics <- calculate_lsm(landscape, what = c("patch", "class"))#'
correlations <- calculate_correlation(metrics)
show_correlation(data = correlations, method = "pearson")


## End(Not run)

landscapemetrics

Landscape Metrics for Categorical Map Patterns

v1.5.2
GPL-3
Authors
Maximillian H.K. Hesselbarth [aut, cre] (<https://orcid.org/0000-0003-1125-9918>), Marco Sciaini [aut] (<https://orcid.org/0000-0002-3042-5435>), Jakub Nowosad [aut] (<https://orcid.org/0000-0002-1057-3721>), Sebastian Hanss [aut] (<https://orcid.org/0000-0002-3990-4897>), Laura J. Graham [ctb] (Input on package structure), Jeffrey Hollister [ctb] (Input on package structure), Kimberly A. With [ctb] (Input on package structure), Florian Privé [ctb] (Original author of underlying C++ code for get_nearestneighbour() function), Project Nayuki [ctb] (Original author of underlying C++ code for get_circumscribingcircle and lsm_p_circle), Matt Strimas-Mackey [ctb] (Bugfix in sample_metrics())
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.