# NOT RUN {
## just get path
mr_shp(key = "MarineRegions:eez_iho_union_v2", read = FALSE)
## read shp file into spatial object
res <- mr_shp(key = "MarineRegions:eez_iho_union_v2", read = TRUE)
mr_shp(key = "SAIL:w_marinehabitatd")
# maxFeatures
library(sp)
plot(mr_shp(key = "MarineRegions:eez_iho_union_v2"))
plot(mr_shp(key = "MarineRegions:eez_iho_union_v2", maxFeatures = 5))
# vizualize with package leaflet
if (requireNamespace("leaflet")) {
library('leaflet')
leaflet() %>%
addTiles() %>%
addPolygons(data = res)
}
# use `filter` param to get a subset of a region
library(sp)
pp <- mr_shp(key = "MarineRegions:eez_iho_union_v2")
plot(pp)
rr <- mr_shp(key = "MarineRegions:eez_iho_union_v2",
filter = "North Atlantic Ocean")
plot(rr)
# get Samoan Exclusive Economic Zone
res <- mr_shp(
key = "MarineRegions:eez",
filter = "Samoan Exclusive Economic Zone"
)
sp::plot(res)
# }
Run the code above in your browser using DataLab