library(sf)
library(MigConnectivity)
#
rawURL <- "[https://raw.githubusercontent.com/SMBC-NZP/MigConnectivity/devpsi2/data-raw/YEWA/](https://raw.githubusercontent.com/SMBC-NZP/MigConnectivity/devpsi2/data-raw/YEWA/)"
target_file <- "YEWA_target_sites.rds"
newDir <- tempdir()
utils::download.file(
url = paste0(rawURL, target_file),
destfile = file.path(newDir, target_file),
mode = "wb"
)
YEWA_target_sites <- readRDS(file.path(newDir, target_file))
# 3. Filter for specific columns
YEWA_target_sites <- YEWA_target_sites[,c("Region", "targetSite", "geometry")]
# 4. Define target names for the model
targetNames <- c("Pacific and Central Mexico",
"Atlantic Lowland Mexico",
"Central America",
"South America")
# plot
plot(st_geometry(YEWA_origin_sites), col = "#F5F5DC", border = "white")
plot(st_geometry(YEWA_target_sites),
col = c("#EBD17D", "#79B4D1", "#0E648B", "#D1997D"),
add = TRUE)