Recently, the American Census Bureau changed the geographical entities reported in the state of Connecticut, as discussed here. Previously, data was reported in the following 8 counties:
CT_counties <- data.frame(county = c("Fairfield County, CT",
"Hartford County, CT",
"Litchfield County, CT",
"Middlesex County, CT",
"New Haven County, CT",
"New London County, CT",
"Tolland County, CT",
"Windham County, CT"),
fips = c("09001",
"09003",
"09005",
"09007",
"09009",
"09011",
"09013",
"09015"))
As usmap
has been updated to facilitate this change, the new 9 planning regions used are:
CT_regions <- data.frame(region = c("Capitol Planning Region",
"Greater Bridgeport Planning Region",
"Lower Connecticut River Valley Planning Region",
"Naugatuck Valley Planning Region",
"Northeastern Connecticut Planning Region",
"Northwest Hills Planning Region",
"South Central Connecticut Planning Region",
"Southeastern Connecticut Planning Region",
"Western Connecticut Planning Region"),
fips = c("09110",
"09120",
"09130",
"09140",
"09150",
"09160",
"09170",
"09180",
"09190"))
Because usmap
uses the new shapefiles, the following code works:
library(usmap)
plotdf <- data.frame(fips = CT_regions$fips, vals = rnorm(9))
plot_usmap(data = plotdf, values = "vals",
include = c("MA", "CT", "RI"),
labels = FALSE)
Producing the following image:
But, since a lot of data is reported at the older county level, it is useful to still be able to plot those. However, this no longer works. The following code gives nothing useful:
library(usmap)
plotdf <- data.frame(fips = CT_counties$fips, vals = rnorm(8))
plot_usmap(data = plotdf, values = "vals",
include = c("MA", "CT", "RI"),
labels = FALSE)
Question: Using usmap
, is there any easy way to plot the counties previously used for Connecticut (CT_counties
) ? Particularly a way that does not involve going back to previous versions of usmap
. As it is useful to be able to do both things in the same script.