Thanks for your interest in contributing to nycOpenData! This package provides convenient R wrappers around NYC Open Data (Socrata) API endpoints and returns results as tidy tibbles with optional filtering, sorting, and row limits.
This guide explains how to report issues, propose changes, and submit pull requests.
Be respectful and constructive. Assume good intent. Harassment or discrimination of any kind is not tolerated. Please refer to CODE_OF_CONDUCT.md for full details.
You can help by:
- Reporting bugs or confusing behavior.
- Suggesting improvements to documentation or examples.
- Adding wrappers for additional NYC Open Data datasets.
- Improving tests and edge-case handling (timeouts, API errors, schema changes).
- Improving performance or developer ergonomics.
Please open an issue with:
- What you expected to happen
- What actually happened
- A minimal reproducible example (copy/paste-able using the
reprexpackage). sessionInfo()output.
If the issue is dataset-specific, include:
- The dataset name and/or NYC Open Data dataset ID (e.g.,
erm2-nwe9). - Any filters used in the function call.
- Whether the issue is intermittent (likely related to rate limits or timeouts).
Fork the repository on GitHub and clone it to your local machine.
Ensure you have the following packages installed for development:
install.packages(c('devtools', 'roxygen2', 'testthat', 'pkgdown', 'vcr', 'webmockr', 'covr'))With about 40 scripts currently in the package, we maintain a strict standard for new data-pulling functions. All new wrappers should:
- Return a
tbl_df(tibble). - Use
httr::GETfor API calls to ensure consistency with our error-handling logic. - Include standard parameters:
limit,filters, andtimeout_sec. - Match existing patterns: Use the standardized column naming conventions provided by the NYC Open Data API.
This package uses the vcr package to mock API responses, ensuring tests are fast and reliable even without an internet connection.
- Write a test in
tests/testthat/using avcr::use_cassette()block. - Record the response: Run the test with an active internet connection to create the initial YAML 'cassette'.
- Verify the fixture: Ensure the
.ymlfile is created intests/testthat/fixtures/. - No Secrets: Ensure you do not record any sensitive API keys or tokens in the cassettes.
We use roxygen2 for documentation. Before submitting a PR:
- Run
devtools::document()to update the NAMESPACE and help files. - Run
pkgdown::build_site()to ensure the documentation website renders correctly.
Before submitting a Pull Request, please run the full suite of checks. We only accept PRs that pass with 0 errors and 0 warnings:
devtools::check()- Create a new branch for your feature or fix.
- Submit the PR against the
mainbranch. - Link the PR to any relevant issues.