Skip to content

Commit

Permalink
Merge pull request #30 from NewYorkCityCouncil/councilcount_migration
Browse files Browse the repository at this point in the history
councilcount migration
  • Loading branch information
nmontalbanocouncil authored Feb 21, 2024
2 parents a3c3e14 + 2d9d079 commit 4987e94
Show file tree
Hide file tree
Showing 31 changed files with 11 additions and 857,181 deletions.
Binary file modified .DS_Store
Binary file not shown.
10 changes: 6 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Package: councilverse
Type: Package
Title: Easily Install and Load all packages in the 'councilverse'
Version: 2.0.0
Authors@R:
Expand All @@ -11,16 +12,17 @@ License: `use_mit_license()`, `use_gpl3_license()` or friends to pick a
license
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
Imports:
cli,
councildown (>= 0.0.3.9000),
councilcount,
crayon,
rstudioapi,
utils,
reticulate
utils
Remotes:
newyorkcitycouncil/councildown
newyorkcitycouncil/councildown,
newyorkcitycouncil/councilcount
Depends:
R (>= 2.10)
LazyData: true
Expand Down
8 changes: 0 additions & 8 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,6 @@
export(councilverse_packages)
export(encodeGraphic)
export(file_name_generator)
export(get_ACS_demographic_estimates)
export(get_BBL_estimates)
export(get_bbl_estimates)
export(get_census_variables)
export(get_geo_estimates)
export(gt_table)
export(unzip_sf)
export(view_ACS_variables)
import(dplyr)
import(htmltools)
import(reticulate)
2 changes: 1 addition & 1 deletion R/attach.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

pkgs <- c("councildown")
pkgs <- c("councildown","councilcount")

councilverse_attach <- function() {
# Create `to_load` which is a character vector of all councilverse
Expand Down
72 changes: 0 additions & 72 deletions R/census_estimates.R

This file was deleted.

9 changes: 0 additions & 9 deletions R/data.R

This file was deleted.

11 changes: 0 additions & 11 deletions R/get_bbl_estimates_function.R

This file was deleted.

12 changes: 0 additions & 12 deletions R/get_census_variables_function.R

This file was deleted.

110 changes: 0 additions & 110 deletions R/get_geo_estimates_function.R

This file was deleted.

76 changes: 1 addition & 75 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -49,81 +49,7 @@ First load the `councilverse` package as above.
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:

# Overview

The `councilcount` package allows easy access to population data for around 70 demographic groups across various NYC geographic boundaries. This data was pulled from the 2017-2021 5-Year American Community Survey. For geographic boundaries that are not included in the ACS, like council districts, estimates were generated.

## Installation

You can install the released version of `councilcount` from GitHub

``` r
remotes::install_github("newyorkcitycouncil/councilcount")
```

## Load Package

Note that the order of loading the libraries is important. Make sure to
load `councilcount` last.

```{r eval=FALSE}
library(tidyverse)
# load last
library(councilcount)
```

## Vignette

For demos of the functions included in `councilcount`, please visit `vignettes/councilverse.Rmd`.

## Quick Start

First load the `councilcount` package as above.

### Functions

#### R

`councilcount` includes 3 functions:

`get_bbl_estimates()` -- Generates a dataframe that provides population estimates at the point level (there are also columns for various other geographies, like council district)
`get_census_variables()` -- Provides information on all of the ACS demographic variables that can be accessed using `get_geo_estimates()` via variable codes
`get_geo_estimates()` -- Creates a dataframe that provides population estimates for selected demographic variables along chosen geographic boundaries (e.g. council district, borough, etc.)

Simply run `get_bbl_estimates()` and `get_census_variables()` to access the desired dataframes. They do not require any inputs.

`get_geo_estimates()` has 3 parameters:

`geo` -- The desired geographic region. Please select from the following list:
** Council Distrist: "councildist"
** Community Distrist: "communitydist"
** School District: "schooldist"
** Police Precinct: "policeprct"
** Neighborhood Tabulation Area: "nta"
** Borough: "borough"
`var_codes` -- The desired demographic group(s), as represented by the ACS variable code. To access the list of available demographic variables and their codes, please run `get_census_variables()`
`boundary_year` -- If "councildist" is selected, the boundary year must be specified as 2013 or 2023. The default is 2013.

Here is an example, in which codes for "Female" and "Adults with Bachelor's degree or higher" are used. The data is requested along 2023 Council District boundaries.
``` r
vars <- c('DP05_0003PE', 'DP02_0068E')
get_geo_estimates(geo = "councildist", var_codes = vars, boundary_year = "2023")
```

#### Python

The equivalent functions are also available in Python. To access them, use the following code:

``` Python
import sys
# set absolute path to councilverse/inst/python location
sys.path.insert(0, "/{YOUR PATH}/councilverse/inst/python")
from retrieve_estimates import get_bbl_estimates, get_census_variables, get_geo_estimates
```

`get_bbl_estimates()` and `get_census_variables()` function the same in both R and Python. However, `get_geo_estimates()` has some differences in Python. Instead of having separate parameters for geo and boundary year, there are two input options for Council Districts, "councildist13" and "councildist23." Data for New York City as a whole is also available using "nyc" for geo. Otherwise, the geo input options are the same. There are also two additional parameters, `polygons` and `download`, with the defaults set at False. If `polygons` is set to True, the dataframe will include a column with the geometries associated with each geographic region. If `download` is set to True, the dataframe will automatically download as a CSV when the function runs.
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.
Expand Down
Loading

0 comments on commit 4987e94

Please sign in to comment.