Skip to contents

Basic map of county outlines within specified state(s) Not used by shiny app

Usage

map_counties_in_state(
  ST = "DE",
  colorcolumn = c("pop", "NAME", "POP_SQMI", "STATE_NAME")[1],
  type = c("leaflet", "mapview")[1]
)

Arguments

ST

a vector of one or more state abbreviations, like

ST = "ME" or ST = c("de", "RI"), or

ST = fips2state_abbrev(fips_state_from_statename(c("Rhode Island", "district of columbia")))

or e.g., all counties in EPA Region 1:

ST = stateinfo$ST[stateinfo$REGION == 1]

colorcolumn

name of column to use in setting colors of counties on map, but must be one returned by shapes_counties_from_countyfips() like "STATE_NAME"

type

must be "leaflet" or can be "mapview" if installed and loaded

Value

a map

Examples

# \donttest{
map_counties_in_state(ST = c('id', 'mt'))
#> Warning: need tidycensus package and census API key to use myservice = 'cartographic', so using default service instead
#> Reading layer `OGRGeoJSON' from data source 
#>   `https://services.arcgis.com/P3ePLMYs2RVChkJx/ArcGIS/rest/services/USA_Boundaries_2022/FeatureServer/2/query?where=FIPS%3D%2716001%27%20OR%20FIPS%3D%2716003%27%20OR%20FIPS%3D%2716005%27%20OR%20FIPS%3D%2716007%27%20OR%20FIPS%3D%2716009%27%20OR%20FIPS%3D%2716011%27%20OR%20FIPS%3D%2716013%27%20OR%20FIPS%3D%2716015%27%20OR%20FIPS%3D%2716017%27%20OR%20FIPS%3D%2716019%27%20OR%20FIPS%3D%2716021%27%20OR%20FIPS%3D%2716023%27%20OR%20FIPS%3D%2716025%27%20OR%20FIPS%3D%2716027%27%20OR%20FIPS%3D%2716029%27%20OR%20FIPS%3D%2716031%27%20OR%20FIPS%3D%2716033%27%20OR%20FIPS%3D%2716035%27%20OR%20FIPS%3D%2716037%27%20OR%20FIPS%3D%2716039%27%20OR%20FIPS%3D%2716041%27%20OR%20FIPS%3D%2716043%27%20OR%20FIPS%3D%2716045%27%20OR%20FIPS%3D%2716047%27%20OR%20FIPS%3D%2716049%27%20OR%20FIPS%3D%2716051%27%20OR%20FIPS%3D%2716053%27%20OR%20FIPS%3D%2716055%27%20OR%20FIPS%3D%2716057%27%20OR%20FIPS%3D%2716059%27%20OR%20FIPS%3D%2716061%27%20OR%20FIPS%3D%2716063%27%20OR%20FIPS%3D%2716065%27%20OR%20FIPS%3D%2716067%27%20OR%20FIPS%3D%2716069%27%20OR%20FIPS%3D%2716071%27%20OR%20FIPS%3D%2716073%27%20OR%20FIPS%3D%2716075%27%20OR%20FIPS%3D%2716077%27%20OR%20FIPS%3D%2716079%27%20OR%20FIPS%3D%2716081%27%20OR%20FIPS%3D%2716083%27%20OR%20FIPS%3D%2716085%27%20OR%20FIPS%3D%2716087%27%20OR%20FIPS%3D%2730001%27%20OR%20FIPS%3D%2730003%27%20OR%20FIPS%3D%2730005%27%20OR%20FIPS%3D%2730007%27%20OR%20FIPS%3D%2730009%27%20OR%20FIPS%3D%2730011%27&outFields=NAME%2CFIPS%2CSTATE_ABBR%2CSTATE_NAME%2CPOP_SQMI&returnGeometry=true&f=geojson' 
#>   using driver `GeoJSON'
#> Simple feature collection with 50 features and 5 fields
#> Geometry type: POLYGON
#> Dimension:     XY
#> Bounding box:  xmin: -117.243 ymin: 41.98819 xmax: -104.0397 ymax: 49.00085
#> Geodetic CRS:  WGS 84
#> Reading layer `OGRGeoJSON' from data source 
#>   `https://services.arcgis.com/P3ePLMYs2RVChkJx/ArcGIS/rest/services/USA_Boundaries_2022/FeatureServer/2/query?where=FIPS%3D%2730013%27%20OR%20FIPS%3D%2730015%27%20OR%20FIPS%3D%2730017%27%20OR%20FIPS%3D%2730019%27%20OR%20FIPS%3D%2730021%27%20OR%20FIPS%3D%2730023%27%20OR%20FIPS%3D%2730025%27%20OR%20FIPS%3D%2730027%27%20OR%20FIPS%3D%2730029%27%20OR%20FIPS%3D%2730031%27%20OR%20FIPS%3D%2730033%27%20OR%20FIPS%3D%2730035%27%20OR%20FIPS%3D%2730037%27%20OR%20FIPS%3D%2730039%27%20OR%20FIPS%3D%2730041%27%20OR%20FIPS%3D%2730043%27%20OR%20FIPS%3D%2730045%27%20OR%20FIPS%3D%2730047%27%20OR%20FIPS%3D%2730049%27%20OR%20FIPS%3D%2730051%27%20OR%20FIPS%3D%2730053%27%20OR%20FIPS%3D%2730055%27%20OR%20FIPS%3D%2730057%27%20OR%20FIPS%3D%2730059%27%20OR%20FIPS%3D%2730061%27%20OR%20FIPS%3D%2730063%27%20OR%20FIPS%3D%2730065%27%20OR%20FIPS%3D%2730067%27%20OR%20FIPS%3D%2730069%27%20OR%20FIPS%3D%2730071%27%20OR%20FIPS%3D%2730073%27%20OR%20FIPS%3D%2730075%27%20OR%20FIPS%3D%2730077%27%20OR%20FIPS%3D%2730079%27%20OR%20FIPS%3D%2730081%27%20OR%20FIPS%3D%2730083%27%20OR%20FIPS%3D%2730085%27%20OR%20FIPS%3D%2730087%27%20OR%20FIPS%3D%2730089%27%20OR%20FIPS%3D%2730091%27%20OR%20FIPS%3D%2730093%27%20OR%20FIPS%3D%2730095%27%20OR%20FIPS%3D%2730097%27%20OR%20FIPS%3D%2730099%27%20OR%20FIPS%3D%2730101%27%20OR%20FIPS%3D%2730103%27%20OR%20FIPS%3D%2730105%27%20OR%20FIPS%3D%2730107%27%20OR%20FIPS%3D%2730109%27%20OR%20FIPS%3D%2730111%27&outFields=NAME%2CFIPS%2CSTATE_ABBR%2CSTATE_NAME%2CPOP_SQMI&returnGeometry=true&f=geojson' 
#>   using driver `GeoJSON'
#> Simple feature collection with 50 features and 5 fields
#> Geometry type: POLYGON
#> Dimension:     XY
#> Bounding box:  xmin: -116.0492 ymin: 44.4768 xmax: -104.0414 ymax: 49.00112
#> Geodetic CRS:  WGS 84
#> Warning: 1 fips had invalid number of characters (digits) or were NA values
#> Warning: NA returned for 1 fips that do not seem to be block, blockgroup, tract, city/CDP, county, or state FIPS (lengths with leading zeroes should be 15,12,11,7,5,2 respectively
#> Warning: 1 fips had invalid number of characters (digits) or were NA values
#> Reading layer `OGRGeoJSON' from data source 
#>   `https://services.arcgis.com/P3ePLMYs2RVChkJx/ArcGIS/rest/services/USA_Boundaries_2022/FeatureServer/2/query?where=FIPS%3D%2730111%27&outFields=NAME%2CFIPS%2CSTATE_ABBR%2CSTATE_NAME%2CPOP_SQMI&returnGeometry=true&f=geojson' 
#>   using driver `GeoJSON'
#> Simple feature collection with 1 feature and 5 fields
#> Geometry type: POLYGON
#> Dimension:     XY
#> Bounding box:  xmin: -108.9254 ymin: 45.46041 xmax: -107.4627 ymax: 46.49605
#> Geodetic CRS:  WGS 84
map_counties_in_state(ST = c('id', 'mt'), colorcolumn = "STATE_NAME") #> Warning: need tidycensus package and census API key to use myservice = 'cartographic', so using default service instead #> Reading layer `OGRGeoJSON' from data source #> `https://services.arcgis.com/P3ePLMYs2RVChkJx/ArcGIS/rest/services/USA_Boundaries_2022/FeatureServer/2/query?where=FIPS%3D%2716001%27%20OR%20FIPS%3D%2716003%27%20OR%20FIPS%3D%2716005%27%20OR%20FIPS%3D%2716007%27%20OR%20FIPS%3D%2716009%27%20OR%20FIPS%3D%2716011%27%20OR%20FIPS%3D%2716013%27%20OR%20FIPS%3D%2716015%27%20OR%20FIPS%3D%2716017%27%20OR%20FIPS%3D%2716019%27%20OR%20FIPS%3D%2716021%27%20OR%20FIPS%3D%2716023%27%20OR%20FIPS%3D%2716025%27%20OR%20FIPS%3D%2716027%27%20OR%20FIPS%3D%2716029%27%20OR%20FIPS%3D%2716031%27%20OR%20FIPS%3D%2716033%27%20OR%20FIPS%3D%2716035%27%20OR%20FIPS%3D%2716037%27%20OR%20FIPS%3D%2716039%27%20OR%20FIPS%3D%2716041%27%20OR%20FIPS%3D%2716043%27%20OR%20FIPS%3D%2716045%27%20OR%20FIPS%3D%2716047%27%20OR%20FIPS%3D%2716049%27%20OR%20FIPS%3D%2716051%27%20OR%20FIPS%3D%2716053%27%20OR%20FIPS%3D%2716055%27%20OR%20FIPS%3D%2716057%27%20OR%20FIPS%3D%2716059%27%20OR%20FIPS%3D%2716061%27%20OR%20FIPS%3D%2716063%27%20OR%20FIPS%3D%2716065%27%20OR%20FIPS%3D%2716067%27%20OR%20FIPS%3D%2716069%27%20OR%20FIPS%3D%2716071%27%20OR%20FIPS%3D%2716073%27%20OR%20FIPS%3D%2716075%27%20OR%20FIPS%3D%2716077%27%20OR%20FIPS%3D%2716079%27%20OR%20FIPS%3D%2716081%27%20OR%20FIPS%3D%2716083%27%20OR%20FIPS%3D%2716085%27%20OR%20FIPS%3D%2716087%27%20OR%20FIPS%3D%2730001%27%20OR%20FIPS%3D%2730003%27%20OR%20FIPS%3D%2730005%27%20OR%20FIPS%3D%2730007%27%20OR%20FIPS%3D%2730009%27%20OR%20FIPS%3D%2730011%27&outFields=NAME%2CFIPS%2CSTATE_ABBR%2CSTATE_NAME%2CPOP_SQMI&returnGeometry=true&f=geojson' #> using driver `GeoJSON' #> Simple feature collection with 50 features and 5 fields #> Geometry type: POLYGON #> Dimension: XY #> Bounding box: xmin: -117.243 ymin: 41.98819 xmax: -104.0397 ymax: 49.00085 #> Geodetic CRS: WGS 84 #> Reading layer `OGRGeoJSON' from data source #> `https://services.arcgis.com/P3ePLMYs2RVChkJx/ArcGIS/rest/services/USA_Boundaries_2022/FeatureServer/2/query?where=FIPS%3D%2730013%27%20OR%20FIPS%3D%2730015%27%20OR%20FIPS%3D%2730017%27%20OR%20FIPS%3D%2730019%27%20OR%20FIPS%3D%2730021%27%20OR%20FIPS%3D%2730023%27%20OR%20FIPS%3D%2730025%27%20OR%20FIPS%3D%2730027%27%20OR%20FIPS%3D%2730029%27%20OR%20FIPS%3D%2730031%27%20OR%20FIPS%3D%2730033%27%20OR%20FIPS%3D%2730035%27%20OR%20FIPS%3D%2730037%27%20OR%20FIPS%3D%2730039%27%20OR%20FIPS%3D%2730041%27%20OR%20FIPS%3D%2730043%27%20OR%20FIPS%3D%2730045%27%20OR%20FIPS%3D%2730047%27%20OR%20FIPS%3D%2730049%27%20OR%20FIPS%3D%2730051%27%20OR%20FIPS%3D%2730053%27%20OR%20FIPS%3D%2730055%27%20OR%20FIPS%3D%2730057%27%20OR%20FIPS%3D%2730059%27%20OR%20FIPS%3D%2730061%27%20OR%20FIPS%3D%2730063%27%20OR%20FIPS%3D%2730065%27%20OR%20FIPS%3D%2730067%27%20OR%20FIPS%3D%2730069%27%20OR%20FIPS%3D%2730071%27%20OR%20FIPS%3D%2730073%27%20OR%20FIPS%3D%2730075%27%20OR%20FIPS%3D%2730077%27%20OR%20FIPS%3D%2730079%27%20OR%20FIPS%3D%2730081%27%20OR%20FIPS%3D%2730083%27%20OR%20FIPS%3D%2730085%27%20OR%20FIPS%3D%2730087%27%20OR%20FIPS%3D%2730089%27%20OR%20FIPS%3D%2730091%27%20OR%20FIPS%3D%2730093%27%20OR%20FIPS%3D%2730095%27%20OR%20FIPS%3D%2730097%27%20OR%20FIPS%3D%2730099%27%20OR%20FIPS%3D%2730101%27%20OR%20FIPS%3D%2730103%27%20OR%20FIPS%3D%2730105%27%20OR%20FIPS%3D%2730107%27%20OR%20FIPS%3D%2730109%27%20OR%20FIPS%3D%2730111%27&outFields=NAME%2CFIPS%2CSTATE_ABBR%2CSTATE_NAME%2CPOP_SQMI&returnGeometry=true&f=geojson' #> using driver `GeoJSON' #> Simple feature collection with 50 features and 5 fields #> Geometry type: POLYGON #> Dimension: XY #> Bounding box: xmin: -116.0492 ymin: 44.4768 xmax: -104.0414 ymax: 49.00112 #> Geodetic CRS: WGS 84 #> Warning: 1 fips had invalid number of characters (digits) or were NA values #> Warning: NA returned for 1 fips that do not seem to be block, blockgroup, tract, city/CDP, county, or state FIPS (lengths with leading zeroes should be 15,12,11,7,5,2 respectively #> Warning: 1 fips had invalid number of characters (digits) or were NA values #> Reading layer `OGRGeoJSON' from data source #> `https://services.arcgis.com/P3ePLMYs2RVChkJx/ArcGIS/rest/services/USA_Boundaries_2022/FeatureServer/2/query?where=FIPS%3D%2730111%27&outFields=NAME%2CFIPS%2CSTATE_ABBR%2CSTATE_NAME%2CPOP_SQMI&returnGeometry=true&f=geojson' #> using driver `GeoJSON' #> Simple feature collection with 1 feature and 5 fields #> Geometry type: POLYGON #> Dimension: XY #> Bounding box: xmin: -108.9254 ymin: 45.46041 xmax: -107.4627 ymax: 46.49605 #> Geodetic CRS: WGS 84
map_counties_in_state(ST = c('id', 'mt'), type = "mapview") #> Warning: need tidycensus package and census API key to use myservice = 'cartographic', so using default service instead #> Reading layer `OGRGeoJSON' from data source #> `https://services.arcgis.com/P3ePLMYs2RVChkJx/ArcGIS/rest/services/USA_Boundaries_2022/FeatureServer/2/query?where=FIPS%3D%2716001%27%20OR%20FIPS%3D%2716003%27%20OR%20FIPS%3D%2716005%27%20OR%20FIPS%3D%2716007%27%20OR%20FIPS%3D%2716009%27%20OR%20FIPS%3D%2716011%27%20OR%20FIPS%3D%2716013%27%20OR%20FIPS%3D%2716015%27%20OR%20FIPS%3D%2716017%27%20OR%20FIPS%3D%2716019%27%20OR%20FIPS%3D%2716021%27%20OR%20FIPS%3D%2716023%27%20OR%20FIPS%3D%2716025%27%20OR%20FIPS%3D%2716027%27%20OR%20FIPS%3D%2716029%27%20OR%20FIPS%3D%2716031%27%20OR%20FIPS%3D%2716033%27%20OR%20FIPS%3D%2716035%27%20OR%20FIPS%3D%2716037%27%20OR%20FIPS%3D%2716039%27%20OR%20FIPS%3D%2716041%27%20OR%20FIPS%3D%2716043%27%20OR%20FIPS%3D%2716045%27%20OR%20FIPS%3D%2716047%27%20OR%20FIPS%3D%2716049%27%20OR%20FIPS%3D%2716051%27%20OR%20FIPS%3D%2716053%27%20OR%20FIPS%3D%2716055%27%20OR%20FIPS%3D%2716057%27%20OR%20FIPS%3D%2716059%27%20OR%20FIPS%3D%2716061%27%20OR%20FIPS%3D%2716063%27%20OR%20FIPS%3D%2716065%27%20OR%20FIPS%3D%2716067%27%20OR%20FIPS%3D%2716069%27%20OR%20FIPS%3D%2716071%27%20OR%20FIPS%3D%2716073%27%20OR%20FIPS%3D%2716075%27%20OR%20FIPS%3D%2716077%27%20OR%20FIPS%3D%2716079%27%20OR%20FIPS%3D%2716081%27%20OR%20FIPS%3D%2716083%27%20OR%20FIPS%3D%2716085%27%20OR%20FIPS%3D%2716087%27%20OR%20FIPS%3D%2730001%27%20OR%20FIPS%3D%2730003%27%20OR%20FIPS%3D%2730005%27%20OR%20FIPS%3D%2730007%27%20OR%20FIPS%3D%2730009%27%20OR%20FIPS%3D%2730011%27&outFields=NAME%2CFIPS%2CSTATE_ABBR%2CSTATE_NAME%2CPOP_SQMI&returnGeometry=true&f=geojson' #> using driver `GeoJSON' #> Simple feature collection with 50 features and 5 fields #> Geometry type: POLYGON #> Dimension: XY #> Bounding box: xmin: -117.243 ymin: 41.98819 xmax: -104.0397 ymax: 49.00085 #> Geodetic CRS: WGS 84 #> Reading layer `OGRGeoJSON' from data source #> `https://services.arcgis.com/P3ePLMYs2RVChkJx/ArcGIS/rest/services/USA_Boundaries_2022/FeatureServer/2/query?where=FIPS%3D%2730013%27%20OR%20FIPS%3D%2730015%27%20OR%20FIPS%3D%2730017%27%20OR%20FIPS%3D%2730019%27%20OR%20FIPS%3D%2730021%27%20OR%20FIPS%3D%2730023%27%20OR%20FIPS%3D%2730025%27%20OR%20FIPS%3D%2730027%27%20OR%20FIPS%3D%2730029%27%20OR%20FIPS%3D%2730031%27%20OR%20FIPS%3D%2730033%27%20OR%20FIPS%3D%2730035%27%20OR%20FIPS%3D%2730037%27%20OR%20FIPS%3D%2730039%27%20OR%20FIPS%3D%2730041%27%20OR%20FIPS%3D%2730043%27%20OR%20FIPS%3D%2730045%27%20OR%20FIPS%3D%2730047%27%20OR%20FIPS%3D%2730049%27%20OR%20FIPS%3D%2730051%27%20OR%20FIPS%3D%2730053%27%20OR%20FIPS%3D%2730055%27%20OR%20FIPS%3D%2730057%27%20OR%20FIPS%3D%2730059%27%20OR%20FIPS%3D%2730061%27%20OR%20FIPS%3D%2730063%27%20OR%20FIPS%3D%2730065%27%20OR%20FIPS%3D%2730067%27%20OR%20FIPS%3D%2730069%27%20OR%20FIPS%3D%2730071%27%20OR%20FIPS%3D%2730073%27%20OR%20FIPS%3D%2730075%27%20OR%20FIPS%3D%2730077%27%20OR%20FIPS%3D%2730079%27%20OR%20FIPS%3D%2730081%27%20OR%20FIPS%3D%2730083%27%20OR%20FIPS%3D%2730085%27%20OR%20FIPS%3D%2730087%27%20OR%20FIPS%3D%2730089%27%20OR%20FIPS%3D%2730091%27%20OR%20FIPS%3D%2730093%27%20OR%20FIPS%3D%2730095%27%20OR%20FIPS%3D%2730097%27%20OR%20FIPS%3D%2730099%27%20OR%20FIPS%3D%2730101%27%20OR%20FIPS%3D%2730103%27%20OR%20FIPS%3D%2730105%27%20OR%20FIPS%3D%2730107%27%20OR%20FIPS%3D%2730109%27%20OR%20FIPS%3D%2730111%27&outFields=NAME%2CFIPS%2CSTATE_ABBR%2CSTATE_NAME%2CPOP_SQMI&returnGeometry=true&f=geojson' #> using driver `GeoJSON' #> Simple feature collection with 50 features and 5 fields #> Geometry type: POLYGON #> Dimension: XY #> Bounding box: xmin: -116.0492 ymin: 44.4768 xmax: -104.0414 ymax: 49.00112 #> Geodetic CRS: WGS 84 #> Warning: 1 fips had invalid number of characters (digits) or were NA values #> Warning: NA returned for 1 fips that do not seem to be block, blockgroup, tract, city/CDP, county, or state FIPS (lengths with leading zeroes should be 15,12,11,7,5,2 respectively #> Warning: 1 fips had invalid number of characters (digits) or were NA values #> Reading layer `OGRGeoJSON' from data source #> `https://services.arcgis.com/P3ePLMYs2RVChkJx/ArcGIS/rest/services/USA_Boundaries_2022/FeatureServer/2/query?where=FIPS%3D%2730111%27&outFields=NAME%2CFIPS%2CSTATE_ABBR%2CSTATE_NAME%2CPOP_SQMI&returnGeometry=true&f=geojson' #> using driver `GeoJSON' #> Simple feature collection with 1 feature and 5 fields #> Geometry type: POLYGON #> Dimension: XY #> Bounding box: xmin: -108.9254 ymin: 45.46041 xmax: -107.4627 ymax: 46.49605 #> Geodetic CRS: WGS 84 #> this function is a nice way to map counties etc. but requires the mapview package, which EJAM does not load #> Warning: mapview package would be needed and is not attached - checking if installed #> Warning: mapview package appears to be installed but not attached. Try using library(mapview) or require(mapview) #> NULL map_counties_in_state(ST = c('id', 'mt'), type = "mapview", colorcolumn = "STATE_NAME") #> Warning: need tidycensus package and census API key to use myservice = 'cartographic', so using default service instead #> Reading layer `OGRGeoJSON' from data source #> `https://services.arcgis.com/P3ePLMYs2RVChkJx/ArcGIS/rest/services/USA_Boundaries_2022/FeatureServer/2/query?where=FIPS%3D%2716001%27%20OR%20FIPS%3D%2716003%27%20OR%20FIPS%3D%2716005%27%20OR%20FIPS%3D%2716007%27%20OR%20FIPS%3D%2716009%27%20OR%20FIPS%3D%2716011%27%20OR%20FIPS%3D%2716013%27%20OR%20FIPS%3D%2716015%27%20OR%20FIPS%3D%2716017%27%20OR%20FIPS%3D%2716019%27%20OR%20FIPS%3D%2716021%27%20OR%20FIPS%3D%2716023%27%20OR%20FIPS%3D%2716025%27%20OR%20FIPS%3D%2716027%27%20OR%20FIPS%3D%2716029%27%20OR%20FIPS%3D%2716031%27%20OR%20FIPS%3D%2716033%27%20OR%20FIPS%3D%2716035%27%20OR%20FIPS%3D%2716037%27%20OR%20FIPS%3D%2716039%27%20OR%20FIPS%3D%2716041%27%20OR%20FIPS%3D%2716043%27%20OR%20FIPS%3D%2716045%27%20OR%20FIPS%3D%2716047%27%20OR%20FIPS%3D%2716049%27%20OR%20FIPS%3D%2716051%27%20OR%20FIPS%3D%2716053%27%20OR%20FIPS%3D%2716055%27%20OR%20FIPS%3D%2716057%27%20OR%20FIPS%3D%2716059%27%20OR%20FIPS%3D%2716061%27%20OR%20FIPS%3D%2716063%27%20OR%20FIPS%3D%2716065%27%20OR%20FIPS%3D%2716067%27%20OR%20FIPS%3D%2716069%27%20OR%20FIPS%3D%2716071%27%20OR%20FIPS%3D%2716073%27%20OR%20FIPS%3D%2716075%27%20OR%20FIPS%3D%2716077%27%20OR%20FIPS%3D%2716079%27%20OR%20FIPS%3D%2716081%27%20OR%20FIPS%3D%2716083%27%20OR%20FIPS%3D%2716085%27%20OR%20FIPS%3D%2716087%27%20OR%20FIPS%3D%2730001%27%20OR%20FIPS%3D%2730003%27%20OR%20FIPS%3D%2730005%27%20OR%20FIPS%3D%2730007%27%20OR%20FIPS%3D%2730009%27%20OR%20FIPS%3D%2730011%27&outFields=NAME%2CFIPS%2CSTATE_ABBR%2CSTATE_NAME%2CPOP_SQMI&returnGeometry=true&f=geojson' #> using driver `GeoJSON' #> Simple feature collection with 50 features and 5 fields #> Geometry type: POLYGON #> Dimension: XY #> Bounding box: xmin: -117.243 ymin: 41.98819 xmax: -104.0397 ymax: 49.00085 #> Geodetic CRS: WGS 84 #> Reading layer `OGRGeoJSON' from data source #> `https://services.arcgis.com/P3ePLMYs2RVChkJx/ArcGIS/rest/services/USA_Boundaries_2022/FeatureServer/2/query?where=FIPS%3D%2730013%27%20OR%20FIPS%3D%2730015%27%20OR%20FIPS%3D%2730017%27%20OR%20FIPS%3D%2730019%27%20OR%20FIPS%3D%2730021%27%20OR%20FIPS%3D%2730023%27%20OR%20FIPS%3D%2730025%27%20OR%20FIPS%3D%2730027%27%20OR%20FIPS%3D%2730029%27%20OR%20FIPS%3D%2730031%27%20OR%20FIPS%3D%2730033%27%20OR%20FIPS%3D%2730035%27%20OR%20FIPS%3D%2730037%27%20OR%20FIPS%3D%2730039%27%20OR%20FIPS%3D%2730041%27%20OR%20FIPS%3D%2730043%27%20OR%20FIPS%3D%2730045%27%20OR%20FIPS%3D%2730047%27%20OR%20FIPS%3D%2730049%27%20OR%20FIPS%3D%2730051%27%20OR%20FIPS%3D%2730053%27%20OR%20FIPS%3D%2730055%27%20OR%20FIPS%3D%2730057%27%20OR%20FIPS%3D%2730059%27%20OR%20FIPS%3D%2730061%27%20OR%20FIPS%3D%2730063%27%20OR%20FIPS%3D%2730065%27%20OR%20FIPS%3D%2730067%27%20OR%20FIPS%3D%2730069%27%20OR%20FIPS%3D%2730071%27%20OR%20FIPS%3D%2730073%27%20OR%20FIPS%3D%2730075%27%20OR%20FIPS%3D%2730077%27%20OR%20FIPS%3D%2730079%27%20OR%20FIPS%3D%2730081%27%20OR%20FIPS%3D%2730083%27%20OR%20FIPS%3D%2730085%27%20OR%20FIPS%3D%2730087%27%20OR%20FIPS%3D%2730089%27%20OR%20FIPS%3D%2730091%27%20OR%20FIPS%3D%2730093%27%20OR%20FIPS%3D%2730095%27%20OR%20FIPS%3D%2730097%27%20OR%20FIPS%3D%2730099%27%20OR%20FIPS%3D%2730101%27%20OR%20FIPS%3D%2730103%27%20OR%20FIPS%3D%2730105%27%20OR%20FIPS%3D%2730107%27%20OR%20FIPS%3D%2730109%27%20OR%20FIPS%3D%2730111%27&outFields=NAME%2CFIPS%2CSTATE_ABBR%2CSTATE_NAME%2CPOP_SQMI&returnGeometry=true&f=geojson' #> using driver `GeoJSON' #> Simple feature collection with 50 features and 5 fields #> Geometry type: POLYGON #> Dimension: XY #> Bounding box: xmin: -116.0492 ymin: 44.4768 xmax: -104.0414 ymax: 49.00112 #> Geodetic CRS: WGS 84 #> Warning: 1 fips had invalid number of characters (digits) or were NA values #> Warning: NA returned for 1 fips that do not seem to be block, blockgroup, tract, city/CDP, county, or state FIPS (lengths with leading zeroes should be 15,12,11,7,5,2 respectively #> Warning: 1 fips had invalid number of characters (digits) or were NA values #> Reading layer `OGRGeoJSON' from data source #> `https://services.arcgis.com/P3ePLMYs2RVChkJx/ArcGIS/rest/services/USA_Boundaries_2022/FeatureServer/2/query?where=FIPS%3D%2730111%27&outFields=NAME%2CFIPS%2CSTATE_ABBR%2CSTATE_NAME%2CPOP_SQMI&returnGeometry=true&f=geojson' #> using driver `GeoJSON' #> Simple feature collection with 1 feature and 5 fields #> Geometry type: POLYGON #> Dimension: XY #> Bounding box: xmin: -108.9254 ymin: 45.46041 xmax: -107.4627 ymax: 46.49605 #> Geodetic CRS: WGS 84 #> this function is a nice way to map counties etc. but requires the mapview package, which EJAM does not load #> Warning: mapview package would be needed and is not attached - checking if installed #> Warning: mapview package appears to be installed but not attached. Try using library(mapview) or require(mapview) #> NULL map_counties_in_state( ST = c( 'md', 'pa'), type = "mapview", colorcolumn = "POP_SQMI") #> Warning: need tidycensus package and census API key to use myservice = 'cartographic', so using default service instead #> Reading layer `OGRGeoJSON' from data source #> `https://services.arcgis.com/P3ePLMYs2RVChkJx/ArcGIS/rest/services/USA_Boundaries_2022/FeatureServer/2/query?where=FIPS%3D%2724001%27%20OR%20FIPS%3D%2724003%27%20OR%20FIPS%3D%2724005%27%20OR%20FIPS%3D%2724009%27%20OR%20FIPS%3D%2724011%27%20OR%20FIPS%3D%2724013%27%20OR%20FIPS%3D%2724015%27%20OR%20FIPS%3D%2724017%27%20OR%20FIPS%3D%2724019%27%20OR%20FIPS%3D%2724021%27%20OR%20FIPS%3D%2724023%27%20OR%20FIPS%3D%2724025%27%20OR%20FIPS%3D%2724027%27%20OR%20FIPS%3D%2724029%27%20OR%20FIPS%3D%2724031%27%20OR%20FIPS%3D%2724033%27%20OR%20FIPS%3D%2724035%27%20OR%20FIPS%3D%2724037%27%20OR%20FIPS%3D%2724039%27%20OR%20FIPS%3D%2724041%27%20OR%20FIPS%3D%2724043%27%20OR%20FIPS%3D%2724045%27%20OR%20FIPS%3D%2724047%27%20OR%20FIPS%3D%2724510%27%20OR%20FIPS%3D%2742001%27%20OR%20FIPS%3D%2742003%27%20OR%20FIPS%3D%2742005%27%20OR%20FIPS%3D%2742007%27%20OR%20FIPS%3D%2742009%27%20OR%20FIPS%3D%2742011%27%20OR%20FIPS%3D%2742013%27%20OR%20FIPS%3D%2742015%27%20OR%20FIPS%3D%2742017%27%20OR%20FIPS%3D%2742019%27%20OR%20FIPS%3D%2742021%27%20OR%20FIPS%3D%2742023%27%20OR%20FIPS%3D%2742025%27%20OR%20FIPS%3D%2742027%27%20OR%20FIPS%3D%2742029%27%20OR%20FIPS%3D%2742031%27%20OR%20FIPS%3D%2742033%27%20OR%20FIPS%3D%2742035%27%20OR%20FIPS%3D%2742037%27%20OR%20FIPS%3D%2742039%27%20OR%20FIPS%3D%2742041%27%20OR%20FIPS%3D%2742043%27%20OR%20FIPS%3D%2742045%27%20OR%20FIPS%3D%2742047%27%20OR%20FIPS%3D%2742049%27%20OR%20FIPS%3D%2742051%27&outFields=NAME%2CFIPS%2CSTATE_ABBR%2CSTATE_NAME%2CPOP_SQMI&returnGeometry=true&f=geojson' #> using driver `GeoJSON' #> Simple feature collection with 50 features and 5 fields #> Geometry type: MULTIPOLYGON #> Dimension: XY #> Bounding box: xmin: -80.51944 ymin: 37.91207 xmax: -74.72152 ymax: 42.26934 #> Geodetic CRS: WGS 84 #> Reading layer `OGRGeoJSON' from data source #> `https://services.arcgis.com/P3ePLMYs2RVChkJx/ArcGIS/rest/services/USA_Boundaries_2022/FeatureServer/2/query?where=FIPS%3D%2742053%27%20OR%20FIPS%3D%2742055%27%20OR%20FIPS%3D%2742057%27%20OR%20FIPS%3D%2742059%27%20OR%20FIPS%3D%2742061%27%20OR%20FIPS%3D%2742063%27%20OR%20FIPS%3D%2742065%27%20OR%20FIPS%3D%2742067%27%20OR%20FIPS%3D%2742069%27%20OR%20FIPS%3D%2742071%27%20OR%20FIPS%3D%2742073%27%20OR%20FIPS%3D%2742075%27%20OR%20FIPS%3D%2742077%27%20OR%20FIPS%3D%2742079%27%20OR%20FIPS%3D%2742081%27%20OR%20FIPS%3D%2742083%27%20OR%20FIPS%3D%2742085%27%20OR%20FIPS%3D%2742087%27%20OR%20FIPS%3D%2742089%27%20OR%20FIPS%3D%2742091%27%20OR%20FIPS%3D%2742093%27%20OR%20FIPS%3D%2742095%27%20OR%20FIPS%3D%2742097%27%20OR%20FIPS%3D%2742099%27%20OR%20FIPS%3D%2742101%27%20OR%20FIPS%3D%2742103%27%20OR%20FIPS%3D%2742105%27%20OR%20FIPS%3D%2742107%27%20OR%20FIPS%3D%2742109%27%20OR%20FIPS%3D%2742111%27%20OR%20FIPS%3D%2742113%27%20OR%20FIPS%3D%2742115%27%20OR%20FIPS%3D%2742117%27%20OR%20FIPS%3D%2742119%27%20OR%20FIPS%3D%2742121%27%20OR%20FIPS%3D%2742123%27%20OR%20FIPS%3D%2742125%27%20OR%20FIPS%3D%2742127%27%20OR%20FIPS%3D%2742129%27%20OR%20FIPS%3D%2742131%27%20OR%20FIPS%3D%2742133%27&outFields=NAME%2CFIPS%2CSTATE_ABBR%2CSTATE_NAME%2CPOP_SQMI&returnGeometry=true&f=geojson' #> using driver `GeoJSON' #> Simple feature collection with 41 features and 5 fields #> Geometry type: POLYGON #> Dimension: XY #> Bounding box: xmin: -80.5195 ymin: 39.71981 xmax: -74.68956 ymax: 42.00158 #> Geodetic CRS: WGS 84 #> this function is a nice way to map counties etc. but requires the mapview package, which EJAM does not load #> Warning: mapview package would be needed and is not attached - checking if installed #> Warning: mapview package appears to be installed but not attached. Try using library(mapview) or require(mapview) #> NULL # }