-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.Rmd
59 lines (41 loc) · 4.14 KB
/
index.Rmd
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%",
dpi = 150
)
```
# nycgeo <img src="man/figures/logo.png" align="right" alt="" width="140" />
[![Travis build status](https://travis-ci.org/mfherman/nycgeo.svg?branch=master)](https://travis-ci.org/mfherman/nycgeo)
[![lifecycle](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
[![CRAN status](https://www.r-pkg.org/badges/version/nycgeo)](https://cran.r-project.org/package=nycgeo)
The `nycgeo` package contains spatial data files for various geographic and administrative boundaries in New York City as well as tools for working with NYC spatial data. Data is in the [`sf` (simple features)](https://r-spatial.github.io/sf/) format and includes boundaries for boroughs (counties), public use microdata areas (PUMAs), community districts (CDs), neighborhood tabulation areas (NTAs), census tracts, census blocks, city council districts, school districts, and police precincts.
Additionally, selected demographic, social, and economic estimates from the U.S. Census Bureau American Community Survey can be added to the geographic boundaries in `nycgeo`, allowing for contextualization and easy choropleth mapping. Finally, `nycgeo` makes it simple to access a subset of spatial data in a particular geographic area, such as all census tracts in Brooklyn and Queens.
## Installation
You can install `nycgeo` from [GitHub](https://https://github.com/mfherman/nycgeo) with:
``` r
# install.packages("remotes")
remotes::install_github("mfherman/nycgeo")
```
To get the most out of `nycgeo`, you should also install and load the [`sf package`](https://r-spatial.github.io/sf/) when you use `nycgeo`. If you haven't attached `sf`, you will get this friendly reminder when you load `nycgeo`:
```{r example-load-nycgeo}
library(nycgeo)
```
Depending on your operating system and available libraries, `sf` can be tricky to install the first time. The [`sf` website](https://r-spatial.github.io/sf/index.html#installing) is a good place to start if you're having trouble. If you're using macOS, [this is a good guide](https://medium.com/@jinwujour/mapping-with-r-on-mac-installation-8c8ef997c6c2) to installing the required libraries.
``` r
# install.packages("sf")
library(sf)
```
## Using `nycgeo`
To learn how to use `nycgeo`, check out the examples in the [Introduction to `nycgeo` vignette](articles/nycgeo.html).
## Why `nycgeo`?
The spatial files contained in the `nycgeo` package are available on websites such as the [New York City Department of City Planning's Bytes of the Big Apple](https://www1.nyc.gov/site/planning/data-maps/open-data.page#district_political) and the [U.S. Census Bureau TIGER/Line® Shapefiles](https://www.census.gov/geo/maps-data/data/tiger-line.html), but this package aims to make accessing the spatial data more convenient. Instead of downloading and converting shapefiles each time you need them, `nycgeo` provides the files in a consistent format (`sf`) with added metadata that enable joins with non-spatial data.
Other R packages share some features with `nycgeo`. In particular, the wonderful [`tidycensus`](https://walkerke.github.io/tidycensus/) package can access the Census Bureau's API and download ACS estimates as well as TIGER/Line® Shapefiles (via [`tigris`](https://github.com/walkerke/tigris)).
One difference between the boundaries included here and the TIGER/Line® Shapefiles available through `tigris` is that these boundaries are clipped to the shoreline, allowing for better mapping of New York City. Additionally, `nycgeo` contains boundaries for geographic areas that are not available from the Census Bureau. This includes neighborhood tabulation areas (NTAs) and community districts (CDs).
Finally, all spatial data included in the package uses the [NAD83 / New York Long Island (ftUS) State Plane projected coordinate system (EPSG 2263)](https://epsg.io/2263), which is the standard projection used by New York City government agencies.