I am using choroplethr to produce choropleths for the rates of a certain health outcome by US state (at the census tract level). After wrestling with the program I was able to get it running, but I would like to modify the bins. I found this link about how to manually code breaks: (https://www.r-bloggers.com/advanced-choroplethr-customized-bins/)
I manually coded my bins but So I coded my cutpoints and the map that was generated looks like:
My lowest bins got put together! Is there a way to specify that I don’t want choroplethr to do that? Is the “num_colors” command my best choice?
Thanks! Sam
ETA: I'm not sure I can make a reproducible example of this. Someone would need to have the FL census tract FIPS codes handy to merge with the values that I would generate using a random number generator. But here is my code in case this helps. I was hoping someone would be able to spot if there was a way to add a specific line of code to stop bins from automatically collapsing.
#manually label classes by given cut points
mydata2$countclass[mydata2$rate_acs ==0 ]<-0
mydata2$countclass[mydata2$rate_acs >0 & mydata2$rate_acs <32.3 ]<-1
mydata2$countclass[mydata2$rate_acs >32.3 & mydata2$rate_acs <43.2 ]<-2
mydata2$countclass[mydata2$rate_acs >43.2 & mydata2$rate_acs <55.8 ]<-3
mydata2$countclass[mydata2$rate_acs >55.8 & mydata2$rate_acs <74.3 ]<-4
mydata2$countclass[mydata2$rate_acs >74.3 ]<-5
mydata2$value = mydata2$countclass
tract_choropleth(mydata2, "florida")