Nothing
## ----include = FALSE----------------------------------------------------------
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
## -----------------------------------------------------------------------------
library(cartographer)
# list registered datasets
feature_types()
# list feature names in one of the datasets
head(feature_names("sf.nc"))
## -----------------------------------------------------------------------------
head(nc_type_example_1)
## ----error = TRUE-------------------------------------------------------------
try({
add_geometry(nc_type_example_1, county, feature_type = "sf.nc")
})
## -----------------------------------------------------------------------------
library(dplyr, warn.conflicts = FALSE)
# cleaned dataset
nc_type_example_1_fixed <-
nc_type_example_1 |>
mutate(county = replace_values(county, "PAMILCO" ~ "PAMLICO"))
add_geometry(nc_type_example_1_fixed, county, feature_type = "sf.nc")
## ----example-basic, fig.width=8, fig.height=2---------------------------------
library(ggplot2)
nc_type_example_1_fixed |>
count(county, type) |>
add_geometry(county, feature_type = "sf.nc") |>
ggplot() +
geom_sf(data = map_sf("sf.nc")) +
geom_sf(aes(fill = n)) +
facet_wrap(vars(type))
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.