-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
84 lines (55 loc) · 3.01 KB
/
README.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
---
output: github_document
always_allow_html: yes
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r setup, include = FALSE}
library(councilverse)
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# Overview
The `councilverse` is a set of packages that work in tandem to assist the NYCC's data team in doing their work. This package is designed to make it easy to install and load multiple 'councilverse' packages in a single step.
## Installation
You can install the released version of `councilverse` from GitHub
``` r
remotes::install_github("newyorkcitycouncil/councilverse")
```
## Load Package
Note that the order of loading the libraries is important. Make sure to load `councilverse` last.
```{r eval=FALSE}
library(tidyverse)
# load last
library(councilverse)
```
## Vignette
For a demo of the 2 largest packages (`councildown` and `councilcount`) available in `councilverse`, see `vignettes/councilverse.Rmd`
## Quick Start
First load the `councilverse` package as above.
### Councildown
The `councildown` package implements style guide compliant defaults for R Markdown documents, `ggplot2` plots, and `leaflet` maps. For more information, please visit the package directly: https://github.com/NewYorkCityCouncil/councildown/ . The `councilverse` vignette goes through an example using most of `councildown`'s available functions.
### Councilcount
The `councilcount` package allows easy access to ACS population data across various geographic boundaries. For the boundaries that are not native to the ACS, such as council districts, an estimate is provided. For more information, please visit the package directly: https://github.com/NewYorkCityCouncil/councilcount/ . The `councilverse` vignette goes through an example using most of `councilcount`'s available functions.
### Other Functions
The following functions are standalone functions in `councilverse` used in more niche situations.
#### Graphs and Tables
`encodeGraphic()` helps convert images to raw HTML. This is useful for adding extra graphics to any HTML element in visualizations. `gt_table()` similarly converts `gt` outputs to raw HTML.
An example of both these functions being used can be found in the NYCHA Scrape repo: https://newyorkcitycouncil.github.io/NYCHA_Scrape/visualization/heat_outage_scatter.html
#### Misc
`file_name_generator()` creates file names using accepted guidelines detailed in the function's documentation.
```{r}
# All fields used
file_name_generator(order = "01", description = "acs_poverty", time_granularity = "daily", disaggregation_categories = c("cd", "race"), date_year = 2018, file_extension = ".R",... = "example")
```
`unzip_sf()` loads in shapefiles that come originally as zip files.
```{r, eval=FALSE}
url <- "https://www1.nyc.gov/assets/planning/download/zip/data-maps/open-data/nyct2020_22a.zip"
# unzip the zip file
zip <- unzip_sf(url)
# assign to variable with read_csv or other read functions
sf <- sf::read_sf(zip)
```