knitr::opts_chunk$set(echo = TRUE, message = FALSE, warning = FALSE)

Introduction

Let's begin with something that's easy to "see".

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")

Basic Filtering

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 Do GIS with R

You can union, intersect, and anything else you can think of. Let's union ...

Pbg_boundary <- st_union(CARE_Pbg_regions)
mapview(Pbg_boundary)

How Should I Learn More?

Two great places to start/explore, and to keep coming back to:



BAAQMD/CARE documentation built on Feb. 26, 2021, 1:31 a.m.