Description Usage Arguments Details Value Examples
Get current boundaries for administrative boundaries in New York City in the simple features sf format. Available boundaries are boroughs, public use microdata areas (PUMAs), community districts (CDs), neighborhood tabulation areas (NTAs), census tracts, and census blocks. Either get all boundaries of a selected geography or a filtered subset.
1 2 3 |
geography |
The requested administrative boundaries. Possible values are "borough", "puma", "cd", "nta", "tract", or "block". |
filter_by |
The geography to filter by. If |
region |
A character vector of regions to filter by. Selected
regions much match the geography indicated by |
add_acs_data |
If |
resolution |
The resolution of the map. Defaults to lower resolution. |
For more information about the metadata included with boundaries, see borough_sf, puma_sf, cd_sf, nta_sf, tract_sf, or block_sf. For information about the census estimates returned, see borough_acs_data, puma_acs_data, nta_acs_data, tract_acs_data, or block_census_data.
An sf
object of administrative boundaries
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | if (require(sf)) {
# get sf boundaires
all_nyc_boroughs <- nyc_boundaries(geography = "borough")
greenpoint_williamsburg_ntas <- nyc_boundaries(
geography = "nta",
filter_by = "puma",
region = "4001",
resolution = "high"
)
queens_brooklyn_tracts <- nyc_boundaries(
geography = "tract",
filter_by = "borough",
region = c("queens", "brooklyn"),
add_acs_data = TRUE
)
# plot boundaries
plot(st_geometry(all_nyc_boroughs))
plot(st_geometry(greenpoint_williamsburg_ntas))
plot(queens_brooklyn_tracts["pop_white_pct_est"])
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.