This is my first time plotting in R, and I would greatly appreciate any help.
I have a dataframe df with two columns, region and value. The region column represents the FIPS codes and the values represents the number I want to plot with regards to the color scale ranging from 0-5000.
I looked at Shading counties using FIPS code in R map but I am not sure how to convert this gray scale shading to colors with either hex or rgb representation. In addition, I do not know how I would shade in colors based off a certain row's values.
This is the code I currently have, and it is plotting a map of the counties (all white) along with their borders.
library(maps)
library(dplyr)
data(county.fips)
year_df <- year_df[c("region", "value")]
counties <- county.fips %>% left_join(year_df, by=c('fips'='region'))
map("county", fill=TRUE)
Thanks in advance!