block_geoid_to {crimedata} | R Documentation |
Convert Census Block GEOIDs
Description
Convert the GEOID of a 2016 US Census block to the name or GEOID for the corresponding state, county, tract or block group.
Usage
block_geoid_to(geoid, to, name = FALSE)
block_geoid_to_state(geoid, name = TRUE)
block_geoid_to_county(geoid, name = TRUE)
block_geoid_to_tract(geoid)
block_geoid_to_block_group(geoid)
Arguments
geoid |
A character vector of 15-digit US Census block GEOIDs. |
to |
One of "state", "county", "tract", "block group" or (as an alias) "blockgroup". |
name |
Should the function return the state/county name rather than FIPS code? |
Details
For details of the format of US Census GEOIDs, see https://www.census.gov/programs-surveys/geography/guidance/geo-identifiers.html.
Value
A character vector of GEOIDs or names.
Examples
block_geoid_to("360810443021005", to = "county", name = TRUE)
[Package crimedata version 0.3.5 Index]