View source: R/dist_pres_vs_bg.R
dist_pres_vs_bg | R Documentation |
For each environmental variable, this function computes the density functions of presences and absences and returns (1-overlap), which is a measure of the distance between the two distributions. Variables with a high distance are good candidates for SDMs, as species occurrences are confined to a subset of the available background.
dist_pres_vs_bg(.data, .col)
.data |
a |
.col |
the column containing the presences; it assumes presences to be the first level of this factor |
a name vector of distances
# This should be updated to use a dataset from tidysdm
data("bradypus", package = "maxnet")
bradypus_tb <- tibble::as_tibble(bradypus) %>%
dplyr::mutate(presence = relevel(
factor(
dplyr::case_match(presence, 1 ~ "presence", 0 ~ "absence")
),
ref = "presence"
)) %>%
select(-ecoreg)
bradypus_tb %>% dist_pres_vs_bg(presence)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.