# 10 11001009803 Census Tract 98.03, District of Columbia, District of Columbia # 9 11001009604 Census Tract 96.04, District of Columbia, District of Columbia # 8 11001007601 Census Tract 76.01, District of Columbia, District of Columbia # 7 11001000704 Census Tract 7.04, District of Columbia, District of Columbia # 6 11001003301 Census Tract 33.01, District of Columbia, District of Columbia # 5 11001008904 Census Tract 89.04, District of Columbia, District of Columbia # 4 11001009802 Census Tract 98.02, District of Columbia, District of Columbia # 3 11001006801 Census Tract 68.01, District of Columbia, District of Columbia # 2 11001002503 Census Tract 25.03, District of Columbia, District of Columbia # 1 11001005003 Census Tract 50.03, District of Columbia, District of Columbia Geometry = TRUE ) dc_income # Simple feature collection with 206 features and 5 fields Library ( tidycensus ) options (tigris_use_cache = TRUE ) dc_income <- get_acs ( As discussed in the previous chapter, the option tigris_use_cache = TRUE is used to cache the downloaded geographic data on the user’s computer. The following example illustrates the use of the geometry = TRUE argument, fetching information on median household income for Census tracts in the District of Columbia. geometry = TRUE combines the automated data download functionality of tidycensus and tigris to allow R users to bypass this process entirely. Loading geometries and data into your desktop GIS of choice Īligning key fields in your desktop GIS and joining your data.Ī major motivation for developing tidycensus was my frustration with having to go through this process over and over again before making a simple map of Census data. These steps include:įetching shapefiles from the Census website ĭownloading a CSV of data, then cleaning and formatting it Traditionally, getting “spatial” Census data requires a tedious multi-step process that can involve several software platforms. The key argument to accomplish this is geometry = TRUE, which is available in the core data download functions in tidycensus, get_acs(), get_decennial(), and get_estimates(). tidycensus wraps several common geographic data functions in the tigris package to allow R users to return simple feature geometry pre-linked to downloaded demographic data with a single function call. The closing parts of the chapter will then turn to interactive mapping, with a focus on the mapview and Leaflet R packages for interactive cartographic visualization.Īs covered in the previous chapter, Census geographies are available from the tigris R package as simple features objects, using the data model from the sf R package. The chapter will then cover how to make static maps of Census demographic data using the popular ggplot2 and tmap visualization packages. In this chapter, readers will learn how to use the geometry parameter in tidycensus functions to download geographic data along with demographic data from the US Census Bureau. In turn, this data model facilitates the creation of both static and interactive demographic maps. Notably, tidycensus enables R users to download simple feature geometry for common geographies, linking demographic information with their geographic locations in a dataset. This chapter will cover the process of map-making using the tidycensus R package. Data from the United States Census Bureau are commonly visualized using maps, given that Census and ACS data are aggregated to enumeration units.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |