evalplot.envSim.hist: Similarity histogram plots for partition groups

View source: R/plotting.R

evalplot.envSim.histR Documentation

Similarity histogram plots for partition groups


Plots environmental similarity of reference partitions (occurrences or background) to remaining data (occurrence and background for all other partitions). This function does not use raster data, and thus only calculates similarity values for data used in model training. Further, this function does not calculate similarity for categorical variables.


  e = NULL,
  occs.z = NULL,
  bg.z = NULL,
  occs.grp = NULL,
  bg.grp = NULL,
  ref.data = "occs",
  sim.type = "mess",
  categoricals = NULL,
  envs.vars = NULL,
  occs.testing.z = NULL,
  hist.bins = 30,
  return.tbl = FALSE,
  quiet = FALSE



ENMevaluation object


data frame: longitude, latitude, and environmental predictor variable values for occurrence records, in that order (optional); the first two columns must be named "longitude" and "latitude"


data frame: longitude, latitude, and environmental predictor variable values for background records, in that order (optional); the first two columns must be named "longitude" and "latitude"


numeric vector: partition groups for occurrence records (optional)


numeric vector: partition groups for background records (optional)


character: the reference to calculate MESS based on occurrences ("occs") or background ("bg"), with default "occs"


character: either "mess" for Multivariate Environmental Similarity Surface, "most_diff" for most different variable, or "most_sim" for most similar variable; uses similarity function from package rmaxent


character vector: names of categorical variables in input RasterStack or data frames to be removed from the analysis; these must be specified as this function was intended for use with continuous data only; these must be specified when inputting tabular data instead of an ENMevaluation object


character vector: names of a predictor variable to plot similarities for; if left NULL, calculations are done with respect to all variables (optional)


data frame: longitude, latitude, and environmental predictor variable values for fully withheld testing records, in that order; this is for use only with the "testing" partition option when an ENMevaluation object is not input (optional)


numeric: number of histogram bins for histogram plots; default is 30


boolean: if TRUE, return the data frames of similarity values used to make the ggplot instead of the plot itself


boolean: if TRUE, silence all function messages (but not errors)


When fully withheld testing groups are used, make sure to input either an ENMevaluation object or the argument occs.testing.z. In the resulting plot, partition 1 refers to the training data, while partition 2 refers to the fully withheld testing group.

Histograms are plotted showing the environmental similarity estimates for each partition group. The similarity between environmental values associated with the validation occurrence or background records per partition group and those associated with the remaining data (occurrences and background) are calculated, and the minimum similarity per grid is returned. For option "mess", higher negative values indicate greater environmental difference between the validation occurrences and the study extent, and higher positive values indicate greater similarity. This function uses the 'similarity()' function from the package 'rmaxent' (https://github.com/johnbaums/rmaxent/) to calculate the similarities. Please see the below reference for details on MESS.


A ggplot of environmental similarities between the occurrence or background data for each partition and the rest of the data (all other occurrences and background data).


Baumgartner J, Wilson P (2021). _rmaxent: Tools for working with Maxent in R_. R package version, <URL: https://github.com/johnbaums/rmaxent>. Elith, J., Kearney, M., and Phillips, S. (2010) The art of modelling range-shifting species. Methods in Ecology and Evolution, 1: 330-342. doi: 10.1111/j.2041-210X.2010.00036.x

ENMeval documentation built on Jan. 9, 2023, 5:08 p.m.