Intro Thoughts
Status Quo
library(tidyverse)
knitr::opts_chunk$set(error = T)
Experiment
library(biscale)
# create classes
example <- bi_class(stl_race_income, x = pctWhite, y = medInc, style = "quantile", dim = 3)
example |> names()
## [1] "GEOID" "pctWhite" "medInc" "geometry" "bi_class"
ggplot(example) +
geom_sf(show.legend = FALSE)
## Error in `geom_sf()`:
## ! Problem while setting up layer.
## ℹ Error occurred in the 1st layer.
## Caused by error in `sym()`:
## ! Can't convert `NULL` to a symbol.
or?
library(tidyverse)
library(biscale)
bi_cross <- function(fill1, fill2){
paste(
cut_number({{fill1}}, 4) |> as.numeric(),
cut_number({{fill2}}, 4) |> as.numeric(),
sep = "-")
}
library(biscale)
stl_race_income |>
ggplot() +
aes(fill =
bi_cross(pctWhite, medInc)) +
geom_sf(show.legend = F) +
bi_scale_fill("GrPink")
