# NOT RUN {
library(Hmisc) # for cut2
# States with greater than 1M residents
df = get_acs_data("B01003", "state")[[1]] # population
df$value = cut2(df$value, cuts=c(0,1000000,Inf))
state_choropleth(df, title="States with a population over 1M", legend="Population")
# Counties with greater than or greater than 1M residents
df = get_acs_data("B01003", "county")[[1]] # population
df$value = cut2(df$value, cuts=c(0,1000000,Inf))
county_choropleth(df, title="Counties with a population over 1M", legend="Population")
# }
Run the code above in your browser using DataLab