knitr::opts_chunk$set(echo = TRUE, message = FALSE, warning = FALSE)
Let's begin with something that's easy to "see".
CARE
package provides some handy "geodata"library(CARE)
The main thing of interest is called CARE_region_geodata
...
show(CARE_region_geodata) # full menu = `data(package = "CARE")`
Let's see that in map form ...
mapview(CARE_region_geodata, zcol = "CARE_designation")
You can filter
this geodata, just like any tabular data ...
impact_regions <- filter(CARE_region_geodata, CARE_designation == "impact") mapview(impact_regions, zcol = "CARE_name")
exceedance_regions <- filter(CARE_region_geodata, CARE_designation == "exceedance") mapview(exceedance_regions, zcol = "CARE_name")
Let's filter
again, this time by CARE_name
.
Pbg_area_names <- c("Pittsburg", "Bethel Island") CARE_Pbg_regions <- filter(CARE_region_geodata, CARE_name %in% Pbg_area_names) mapview(CARE_Pbg_regions, zcol = "CARE_name")
You can union, intersect, and anything else you can think of. Let's union ...
Pbg_boundary <- st_union(CARE_Pbg_regions) mapview(Pbg_boundary)
Two great places to start/explore, and to keep coming back to:
mapview
package, a good bridge for ArcGIS or QGIS "explorers"sf
package, for (modern) technical fundamentals of spatial data in RAdd the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.