Skip to contents

Wraps the NYC OpenData "Police Precincts" feed (77 precincts + the special precinct 22 / Central Park alias = 78 rows in this fixture). Used as the resolver for the arrest_precinct / addr_pct_cd / complaint_precinct_code foreign keys on every NYPD CJ dataset (3NN).

Usage

morie_datasets_nyc_police_precincts(
  offline = TRUE,
  geometry = FALSE,
  max_features = NULL,
  resource_id = NULL,
  mode = c("soda2", "soda3"),
  paginate = FALSE,
  page_size = 1000L,
  max_pages = 200L,
  app_token = NULL
)

Arguments

offline

If TRUE (default), read the bundled fixture.

geometry

If TRUE and offline = FALSE, include the the_geom MultiPolygon.

max_features

Optional row cap.

resource_id

Optional view id override (default "sp34-6z76").

mode

One of "soda2" (default JSON resource endpoint) or "soda3" (SoQL query endpoint). 3AAA dual-mode dispatch.

paginate

Logical; 3OO/3QQ opt-in pagination via LIMIT n OFFSET m.

page_size

Per-page row count when paginating.

max_pages

Safety net.

app_token

Optional Socrata app token (sent as X-App-Token).

Value

A data.frame.

Details

Attribute schema: precinct (string, "1"-"123"), shape_leng, shape_area. Live mode also returns the_geom MultiPolygon when geometry = TRUE.