Description Usage Arguments Value Examples
Calculates a distance matrix from a list of geoids which correspond to either tract of block group ids for a given year. Alternatively calculates distance matrix for a sf data frame of polygons.
1 2 3 4 5 6 7 |
GEOIDs |
Character vector of GEOIDs of either tracts or block groups |
year |
The year, or endyear, of the ACS sample or Census. 2012 through 2018 are available for ACS and 2000 and 2010 for Census. Defaults to 2010. |
geoid_sf |
Alternative specification where an sf object is supplied and distances are calculated directly from that object |
matrix |
Logical whether to return a matrix rather than data frame. |
adjust |
Logical, adjust using Massey Denton specification. |
data frame or matrix indicating distance between geometry centroids in kilometers.
1 2 3 | # get distances of all block groups in DC
geo_distance(geoid_sf = block_groups("DC", class = "sf"), matrix = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.