Example II
Historical habitat
This map shows the accumulated search effort for Crassula connata over its historical habitat covering 6 grid cells in Bellhouse Park:
cracon_agm <- read.csv("Analysis_outputs/Intermediate/Crassula connata_accepted_grouped_merged.csv")
cracon_historical <- cracon_agm %>% dplyr::filter(assigned_community == "CC1")
cracon_sf = assign_cell_geometry_sf(cracon_historical, galgrid)
cracon_sf$scaled_se = cracon_sf$search_effort / cracon_sf$area_prop
eps <- 1e-6
# Scale legend palette for legibility
f_transform <- function(x, eps = 1e-6) {
log(1 + log(x + eps))
}
f_inverse <- function(y) {
exp(exp(y) -1)
}
min_val <- min(c(cracon_sf$search_effort, cracon_sf$scaled_se), na.rm = TRUE)
max_val <- max(c(cracon_sf$search_effort, cracon_sf$scaled_se), na.rm = TRUE)
domain_trans <- f_transform(c(min_val, max_val))
pal <- colorNumeric(
palette = "viridis",
domain = domain_trans
)
m <- leaflet(data = cracon_sf) %>%
addProviderTiles("Esri.WorldImagery") %>%
addPolygons(
fillColor = ~pal(f_transform(search_effort)),
fillOpacity = 0.8,
color = "#BDBDC3",
weight = 1
) %>%
addLegend(
pal = pal,
values = domain_trans,
labFormat = leaflet::labelFormat(
transform = function(y) f_inverse(y),
digits = 2
),
opacity = 0.8,
title = "Accumulated Search Effort in ks"
)
mSome cells at the fringe of the habitat patch overlap only partially with valid habitat; within these cells, search effort should not scale to the full 30 × 30 m cell area. We therefore scale search effort in proportion to the area of habitat contained within each cell.
m <- leaflet(data = cracon_sf) %>%
addProviderTiles("Esri.WorldImagery") %>%
addPolygons(
fillColor = ~pal(f_transform(scaled_se)),
fillOpacity = 0.8,
color = "#BDBDC3",
weight = 1
) %>%
addLegend(
pal = pal,
values = domain_trans,
labFormat = leaflet::labelFormat(
transform = function(y) f_inverse(y),
digits = 2
),
opacity = 0.8,
title = "Accumulated Search Effort (ks)"
)
mThis plot is based on an AGM (accepted, grouped, merged) table produced by our workflow that aggregates the search-trace data, grids it into cells, and intersects those cells with the habitat polygons. Shown here is the subset of data for the six Bellhouse Park cells:
This data format is explained in the previous example.
Potential habitat
This map shows accumulated search effort targeting Crassula connata throughout both historical and potential habitat:
See the vignette covering inference of extirpation in historical habitat for further explanation of the data format underlying this plot.