nyc_boundaries: Get NYC administrative boundaries and census data

Description Usage Arguments Details Value Examples

Description

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.

Usage

1
2
3
nyc_boundaries(geography = c("borough", "puma", "nta", "cd", "tract",
  "block", "school", "police", "council", "cong"), filter_by = NULL,
  region = NULL, add_acs_data = FALSE, resolution = c("low", "high"))

Arguments

geography

The requested administrative boundaries. Possible values are "borough", "puma", "cd", "nta", "tract", or "block".

filter_by

The geography to filter by. If NULL, all boundaries of selected geography are returned.

region

A character vector of regions to filter by. Selected regions much match the geography indicated by filter_by argument.

add_acs_data

If TRUE, selected demographic, social, and economic data from the U.S. Census Bureau American Community Survey is appended to boundaries.

resolution

The resolution of the map. Defaults to lower resolution.

Details

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.

Value

An sf object of administrative boundaries

Examples

 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"])
}

mfherman/nycgeo documentation built on May 3, 2019, 1:34 p.m.