get_xwalk | R Documentation |
This function provides a curated assortment of standardized geographic crosswalks.
Though limited in scope, it provides quick and consistent access to many of the
standard crosswalks used in APDE. If there is a common crosswalk missing
among the options in list_ref_xwalk()
, please let us know by posting a detailed
request in a GitHub issue.
If you need less common crosswalks that are not available through this function, please
explore the spatial data built into rads.data,
e.g., rads.data::spatial_geocomp_blk10_kps
. These rads.data tables were
created by many people over many years so you should expect to invest some time
in exploration and data harmonization to prepare your two columns of interest.
get_xwalk(geo1 = NA, geo2 = NA)
geo1 |
character vector of length 1 defining one half of the crosswalk
desired, e.g., |
geo2 |
character vector of length 1 defining the other half of the
crosswalk desired, e.g., |
A list of all acceptable geographic pairings can be found by typing
list_ref_xwalk()
.
Note that the pairings given as arguments to this function are critical but
the order is not. In other words, get_xwalk(geo1 = 'zip', geo2 = 'city')
will return the same table as get_xwalk(geo1 = 'city', geo2 = 'zip')
.
blk1
: 2010 Census Block. 15 digit Census GEOID (e.g., 530330110012006).
1-2: State (53 = WA)
3-5: County (033 = King County)
6-11: Tract (011001)
12: Block group (2)
12-15: Block (2006)
ccd10
: 2010 Seattle City Council Districts
city
: King County cities
coo10
: 2010 COO places.
hra10
: 2010 Health Reporting Areas
kc
: King County
kccd10
: 2010 King County Council Districts
lgd10
: 2010 WA State legislative districts
puma10
: 2010 Public Use Microdata Areas
region10
: King County regions (North, South, East, & Seattle)
scd10
: 2010 King County school districts
sea10
: Seattle or KC except Seattle
tract10
: 2010 Census Tract. 11 digit Census GEOID.
zip
: Zip codes in King County.
Note! This is different from the 133 zip
codes used with HCA data. To view the latter, please type rads.data::spatial_zip_hca
.
If you're merging the crosswalk table onto line level data, you can use
rads::calc
, or data.table
, or whatever package you like
for further analysis. However, if you're merging on to pre-aggregated data,
to further collapse/aggregate/sum, you'll need to properly account for error
propagation. Here is a line of data.table
code as an example:
DT[, list(estimate = sum(estimate), stderror = sqrt(sum(stderror)^2)), c(group_by_vars)]
a data.table with two columns of geographic identifiers
myxwalk <- get_xwalk(geo1 = 'zip', geo2 = 'city')
myxwalk[]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.