# Use sample_dataset
data("sample_dataset")
data("all_mpas")
vms_cleaned <- vms_clean(sample_dataset)
vms_mpas <- join_mpa_data(vms_cleaned, all_mpas)
# Plotting data
# Points NOT inside MPA are removed to reduce data size
vms_mpas_sub <- vms_mpas |>
dplyr::filter(zone != "open area")
vms_mpas_sf <- sf::st_as_sf(vms_mpas_sub, coords = c("longitude", "latitude"), crs = 4326)
# Loading Mexico shapefile
data("mx_shape")
# Map
library(ggplot2)
ggplot(mx_shape, col = "gray90") +
geom_sf(data = all_mpas, fill = "gray60") +
geom_sf(data = vms_mpas_sf, aes(col = zone)) +
theme_void() +
theme(legend.position = "")
Run the code above in your browser using DataLab