I'm trying to change the color of my statebins map. I'm super new to R and still learning a lot, and googling around hasn't really helped.
This is what the sample looks like:
fipst stab state color
1 37 NC North Carolina 2
2 1 AL Alabama 2
3 28 MS Mississippi 2
4 5 AR Arkansas 2
5 47 TN Tennessee 2
6 45 SC South Carolina 1
7 23 ME Maine 2
49 32 NV Nevada 1
50 15 HI Hawaii 2
51 11 DC District of Columbia 2
digitaltax <- structure(list(fipst = c(37L, 1L, 28L, 5L, 47L, 45L, 23L, 32L,15L, 11L), stab = c("NC", "AL", "MS", "AR", "TN", "SC", "ME","NV", "HI", "DC"), state = c("North Carolina", "Alabama", "Mississippi","Arkansas", "Tennessee", "South Carolina", "Maine", "Nevada","Hawaii", "District of Columbia"), color = c(2L, 2L, 2L, 2L,2L, 1L, 2L, 1L, 2L, 2L)), row.names = c(1L, 2L, 3L, 4L, 5L, 6L,7L, 49L, 50L, 51L), class = "data.frame")
==X==============================================================X==
mutate(
digitaltax,
share = cut(color, breaks = 3, labels = c("No sales tax", "Exempts digital goods", "Taxes digital goods"))
) %>%
statebins(
value_col = "share", font_size = 2.5,
ggplot2_scale_function = scale_fill_brewer,
name = ""
) +
labs(title = "Which states tax digital products?") + theme_statebins()
This produces a map with a range of blues. How can I change the color? No matter what I've tried and found on google, it always throws this error:
Error in ggplot2_scale_function(...) : could not find function "ggplot2_scale_function"
Any help at all would be super appreciated. Thank you!