plot_pres_vs_bg {tidysdm}R Documentation

Plot presences vs background

Description

Create a composite plots contrasting the distribution of multiple variables for presences vs the background.

Usage

plot_pres_vs_bg(.data, .col)

Arguments

.data

a data.frame (or derived object, such as tibble::tibble, or sf::st_sf) with values for the bioclimate variables for presences and background

.col

the column containing the presences; it assumes presences to be the first level of this factor

Value

a patchwork composite plot

Examples


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 %>% plot_pres_vs_bg(presence)


[Package tidysdm version 0.9.4 Index]