hist_evalues {nichevol}R Documentation

Histograms of environmental conditions in M and for occurrences (one species)

Description

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.

Usage

hist_evalues(M, occurrences, species, longitude, latitude, variable,
             CL_lines = c(95, 99), col = NULL)

Arguments

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 occurrences that contains the name of the species.

longitude

(character) name of the column in occurrences containing values of longitude.

latitude

(character) name of the column in occurrences containing values of latitude.

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.

Details

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.

Examples

# 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"))

[Package nichevol version 0.1.20 Index]