Giter Club home page Giter Club logo

cincy's Introduction

cincy

R-CMD-check

The cincy package contains simple feature geographic polygon files (sf objects) that define Cincinnati Neighborhood, Tract, County, and ZIP Code Geographies.

Installing

# install.packages("remotes")
remotes::install_github("geomarker-io/cincy")

Data

Data objects are data.frames of class sf and are named by geography, source, and optionally vintage:

name geography source vintage
zcta_tigris_2020 zcta tigris 2020
zcta_tigris_2010 zcta tigris 2010
zcta_tigris_2000 zcta tigris 2000
tract_tigris_2020 tract tigris 2020
tract_tigris_2010 tract tigris 2010
tract_tigris_2000 tract tigris 2000
neigh_sna neigh sna
neigh_cchmc_2020 neigh cchmc 2020
neigh_cchmc_2010 neigh cchmc 2010
neigh_ccc neigh ccc
districts_tigris_2013 districts tigris 2013
districts_tigris_2011 districts tigris 2011
county_swoh_2010 county swoh 2010
county_hlthvoh_2010 county hlthvoh 2010
county_hlthv_2010 county hlthv 2010
county_8cc_2010 county 8cc 2010
county_7cc_2010 county 7cc 2010
blockgroup_tigris_2020 blockgroup tigris 2020
blockgroup_tigris_2010 blockgroup tigris 2010
blockgroup_tigris_2000 blockgroup tigris 2000

Use autocomplete functionality at the R prompt (e.g., typing cincy:: and pressing TAB twice) to find the needed sf object, narrowing first based on geography (tract, zcta, neigh, county), then by source, and then optionally by vintage.

Consult the help file for any object for more information on the data within it:

?cincy::neigh_ccc

Or explore the data documentation online at https://geomarker.io/cincy/reference

Examples

Data are returned as simple features objects. For example, to get Cincinnati neighborhoods, as defined by the most recent version of community council boundaries from CAGIS:

cincy::neigh_ccc
## Simple feature collection with 75 features and 1 field
## Geometry type: MULTIPOLYGON
## Dimension:     XY
## Bounding box:  xmin: 964487.9 ymin: 1841115 xmax: 994473.1 ymax: 1859227
## Projected CRS: NAD83(NSRS2007) / Conus Albers
## First 10 features:
##                    neighborhood                          SHAPE
## 1                 Paddock Hills MULTIPOLYGON (((983858.4 18...
## 2          Corryville - Heights MULTIPOLYGON (((981244.6 18...
## 3            South Cumminsville MULTIPOLYGON (((978487.3 18...
## 4     Avondale - North Avondale MULTIPOLYGON (((982120.1 18...
## 5                    Corryville MULTIPOLYGON (((981595.8 18...
## 6          Spring Grove Village MULTIPOLYGON (((978574.3 18...
## 7            CUF - Mount Auburn MULTIPOLYGON (((981416 1848...
## 8  Columbia Tusculum - East End MULTIPOLYGON (((987788.4 18...
## 9                 Mount Lookout MULTIPOLYGON (((988778.2 18...
## 10      Riverside - Sayler Park MULTIPOLYGON (((967897.9 18...

Or to get Cincinnati ZIP Codes, as defined by the Census Bureau as ZIP Code Tabulation Areas (ZCTAs), from 2000:

cincy::zcta_tigris_2000
## Simple feature collection with 53 features and 1 field
## Geometry type: MULTIPOLYGON
## Dimension:     XY
## Bounding box:  xmin: 953086.5 ymin: 1838982 xmax: 1003658 ymax: 1871411
## Projected CRS: NAD83(NSRS2007) / Conus Albers
## First 10 features:
##    zcta_2000                       geometry
## 1      45216 MULTIPOLYGON (((983383.8 18...
## 2      45174 MULTIPOLYGON (((998460.5 18...
## 3      45229 MULTIPOLYGON (((982399.8 18...
## 4      45217 MULTIPOLYGON (((982959 1853...
## 5      45252 MULTIPOLYGON (((968113.2 18...
## 6      45239 MULTIPOLYGON (((975836.6 18...
## 7      45243 MULTIPOLYGON (((998121.2 18...
## 8      45236 MULTIPOLYGON (((990544 1856...
## 9      45220 MULTIPOLYGON (((979634.1 18...
## 10     45204 MULTIPOLYGON (((976776.7 18...

Alternatively, get the 2010 Counties in Cincinnati’s 7-county catchment area:

cincy::county_7cc_2010
## Simple feature collection with 7 features and 5 fields
## Geometry type: MULTIPOLYGON
## Dimension:     XY
## Bounding box:  xmin: 949713.7 ymin: 1808108 xmax: 1025618 ymax: 1903358
## Projected CRS: NAD83(NSRS2007) / Conus Albers
##   county_name county_id state_name state_id geoid
## 1      Butler       017         OH       39 39017
## 2    Hamilton       061         OH       39 39061
## 3    Clermont       025         OH       39 39025
## 4      Warren       165         OH       39 39165
## 5      Kenton       117         KY       21 21117
## 6       Boone       015         KY       21 21015
## 7    Campbell       037         KY       21 21037
##                         geometry
## 1 MULTIPOLYGON (((968901.4 18...
## 2 MULTIPOLYGON (((954168.6 18...
## 3 MULTIPOLYGON (((1002941 186...
## 4 MULTIPOLYGON (((991479.4 18...
## 5 MULTIPOLYGON (((974627.4 18...
## 6 MULTIPOLYGON (((953225.9 18...
## 7 MULTIPOLYGON (((990745 1832...

cincy's People

Contributors

erikarasnick avatar cole-brokamp avatar

Watchers

 avatar

cincy's Issues

transfer the comparison maps to shiny

The synced leaflet maps are very cool, but cause problems when there is not enough RAM to process it -- which looks like what is happening on github actions on Windows builds and when the pkgdown site gets published.

Should we break out this small side-by-side map into a shiny app? Maybe include the code to reproduce the leaflet map in the package as a function and then don't render it in a vignette or pkgdown?

function to add cincy neighborhood

  • use internal mapping data (cincy:::hamilton_tract_to_cincy_neighborhood) that is created from version controlled CSV as source of truth for adding neighborhood based on tract
  • rename CSV file to include tract vintage (2010...)
  • rearrange columns for use with census_merger
  • add function to add neighborhood to tract
    • cincy::add_neighborhood()
    • tidy tibble in / tibble out
    • check for census_tract_id_2010 (or census_tract_id_2020 eventually)
    • only support that CSV file (not CAGIS neigh)

column names for returned geographical areas

Right now, our cincy::tract_*_*() functions return the census tract identifier as tract_fips. Should we harmonize this with other instances where we use census tract identifier column names?

  • hh_acs_measures uses census_tract_id and census_tract_vintage
  • dep_index uses census_tract_fips
  • degauss-org/census_block_group uses census_tract_id_2010, census_tract_id_2020
  • degauss-org/st_census_tract uses census_tract_id and census_tract_vintage columns

county groupings

add additional objects:

tibble of county name, state name, county_id (5 digit fips), sf geometry column

include for each area definitions in XLSX file on OneDrive

get_county_grouping(grouping = c("healthvine", "healthvine OH-KY-IN", "8-county catchment", "7-county catchment", "southwestern ohio")

create vignette comparing geographies

  • educating users of types of geographies available for Cincinnati
  • comparison of different neighborhood sources
  • demonstration of neighborhood CCHMC and census tract mapping

unexpected interpolate behavior when geography id columns have same name

dplyr::group_by(!!rlang::sym(to_id)) |>
'

when from_id and to_id have the same name, this gets grouped by whichever one is first in the data (usually from_id instead of to_id)

example:

interpolate(from = cincy::tract_tigris_2020 |> filter(census_tract_id %in% c("39061026104", "39061026103")),
to = cincy::tract_tigris_2010 |> filter(census_tract_id == "39061026101"), 
wt = "pop")

returns missing values for 39061026101

but

interpolate(from = cincy::tract_tigris_2020 |> filter(census_tract_id %in% c("39061026104", "39061026103")) |> rename(census_tract_id_2020 = census_tract_id),
to = cincy::tract_tigris_2010 |> filter(census_tract_id == "39061026101") |> rename(census_tract_id_2010 = census_tract_id), 
wt = "pop")

works as expected.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.