This code was orginally posted by Ramnath
The original code starts below:
This is a rewrite of the mapping code used in this post by Diego Valle. It basically replaces all the boilerplate code with the ichoropleth function in rMaps, which wraps it, allowing easier reuse. Please follow the code from the original post to the get the shapefiles, topojson and data. My note will start with the dataset hom.
d1 <- ichoropleth(rate ~ name, data = hom, ncuts = 9, pal = 'YlOrRd',
animate = 'year', map = 'states'
)