hist_evalues | R Documentation |
hist_evalues helps in creating histograms to explore environmental conditions in M, lines for the confidence limits of values in M, and the location of values in occurrence records, for one species at the time.
hist_evalues(M, occurrences, species, longitude, latitude, variable,
CL_lines = c(95, 99), col = NULL)
M |
a SpatVector object representing the accessible area (M) for one species. See details. |
occurrences |
a data.frame of occurrence records for one species. See details. |
species |
(character) name of the column in |
longitude |
(character) name of the column in |
latitude |
(character) name of the column in |
variable |
a single SpatRaster layer representing an environmental variable of interest. See details. |
CL_lines |
(numeric) confidence limits of environmental values in M to be plotted as lines in the histograms. See details. Default = c(95, 99). |
col |
colors for lines representing confidence limits. If NULL, colors are selected from a gray palette. Default = NULL. |
Coordinates in occurrences
, SpatVector object in M
, and
SpatRaster in variable
must coincide in the geographic projection in
which they are represented. WGS84 with no planar projection is recommended.
The accessible area (M) is understood as the geographic area that has been accessible to a species over relevant periods of time. Defining M is usually a hard task, but also a very important one because it allows identifying uncertainties about the ability of a species to maintain populations under certain environmental conditions. For further details on this topic, see Barve et al. (2011) doi:10.1016/j.ecolmodel.2011.02.011 and Machado-Stredel et al. (2021) doi:10.21425/F5FBG48814.
# example data
## list of species records
data("occ_list", package = "nichevol")
## list of species accessible areas
m_files <- list.files(system.file("extdata", package = "nichevol"),
pattern = "m\\d.gpkg", full.names = TRUE)
m_list <- lapply(m_files, terra::vect)
## raster variable
temp <- terra::rast(system.file("extdata", "temp.tif", package = "nichevol"))
# running stats
hist_evalues(M = m_list[[1]], occurrences = occ_list[[1]], species = "species",
longitude = "x", latitude = "y", variable = temp,
CL_lines = c(95, 99), col = c("blue", "red"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.