I'm trying to use choroplethr to make a map at the county level. Currently, I have 3 categorical integers (1, 2, 3) in my csv under the column value which vary depending on each county. The region column contains county fips.
I want to display the following values as the respective label , color (value = label = color):
0 = "None" = "white", 1 = "MD" = "#64acbe", 2 = "DO" = "#c85a5a", 3 = "Both" = "#574249",
I've tried several combinations of scale_fill_brewer without the results I'm looking for. Any assistance would be great. Here's code that simulates the data I'm using:
library(choroplethr)
library(ggplot2)
library(choroplethrMaps)
Res <- data.frame(
region = c(45001, 22001, 51001, 16001, 19001, 21001, 29001, 40001, 8001, 19003, 16003, 17001, 18001, 28001, 38001, 31001, 39001, 42001, 53001, 55001, 50001, 72001, 72003, 72005, 72007, 72009, 45003, 27001),
value = c(0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3),
stringsAsFactors = FALSE)
county_choropleth(Res,
title = "All United States Medical Residencies",
legend = "Types of Medical Residencies"
)

