View source: R/plot_pres_vs_bg.R
plot_pres_vs_bg | R Documentation |
Create a composite plots contrasting the distribution of multiple variables for presences vs the background.
plot_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 patchwork
composite plot
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.