New Graph Reporting — utilities for dynamic, reproducible environmental data-science reporting.
A curated set of helpers that recurring tasks across spatial-data ingest, STAC catalog browsing, BC hydrology data, GitHub-issue scraping, S3 object handling, filesystem operations, Excel-formula introspection, and Rmarkdown report wiring all need but no single domain package owns. Organized by domain prefix so functions are findable by what they do, not where they grew up.
Installation
pak::pak("NewGraphEnvironment/ngr")Function domains
Functions are named by prefix so the API surface is browseable as a flat list. 46 exports across 11 prefixes:
| Prefix | Domain | Sample functions |
|---|---|---|
ngr_spk_* |
Deprecated — moved to spacehakr. All 12 remain as shims that warn and delegate. |
spacehakr::spk_gdalwarp(), spacehakr::spk_stac_calc(), spacehakr::spk_join()
|
ngr_str_* |
String + path manipulation, file-content rewriting |
ngr_str_extract_between(), ngr_str_replace_in_files(), ngr_str_viewer_cog(), ngr_str_link_url()
|
ngr_fs_* |
Filesystem helpers — typed read/write, conditional copy |
ngr_fs_type_read(), ngr_fs_type_write(), ngr_fs_copy_if_missing()
|
ngr_s3_* |
S3 object listing + download + URL transforms |
ngr_s3_keys_get(), ngr_s3_dl(), ngr_s3_path_to_https(), ngr_s3_files_to_index()
|
ngr_git_* |
GitHub issue + comment scraping (REST API) |
ngr_git_issue(), ngr_git_issue_details()
|
ngr_hyd_* |
BC hydrometric data via tidyhydat |
ngr_hyd_q_daily(), ngr_hyd_realtime()
|
ngr_xl_* |
Excel formula introspection — read formulas, map column names, rewrite |
ngr_xl_read_formulas(), ngr_xl_map_colnames(), ngr_xl_map_formulas()
|
ngr_tidy_* |
tidyverse-flavored helpers — column drop / type compare / coerce |
ngr_tidy_cols_rm_na(), ngr_tidy_cols_type_compare(), ngr_tidy_type()
|
ngr_dbqs_* |
DB-query string builders — predicate filters, identifier quoting, ltree
|
ngr_dbqs_filter_predicate(), ngr_dbqs_ltree(), ngr_dbqs_tbl_quote()
|
ngr_chk_* |
Validation + coercion (chk-flavoured) |
ngr_chk_coerce_date(), ngr_chk_dt_complete()
|
ngr_sed_* |
sed-style bulk replacement across files | ngr_sed_replace_in_files() |
Example: GitHub issue threads
ngr wraps common workflows so the noisy parts (auth headers, pagination, JSON walking) stay out of report chunks.
Grab the full thread of a GitHub issue — body plus every comment — for a report-generating workflow:
issue <- ngr_git_issue_details("NewGraphEnvironment/ngr", 34)
issue$body
issue$comments[[1]]$bodyVignettes
The two STAC vignettes moved to spacehakr along with the spk_* functions they demonstrate.
Roadmap
ngr is a working catch-all that’s gradually being rationalized into focused packages — when a prefix group reaches enough mass to stand on its own, it moves. Active direction:
-
Spatial-kit extraction (#7) — done. All 12
ngr_spk_*functions now live in spacehakr asspk_*; ngr keeps deprecated shims that warn and delegate. -
Reproducible Posit Package Manager helpers (#31) —
ngr_rspm_*family for faster GitHub Actions builds against pinned snapshots. -
HTML widget head-injection (#34) —
ngr_html_head_inject()for setting title + favicon + arbitrary<head>on saved widget pages. -
Date validation + coercion (#21) — round out the
ngr_chk_*family. -
String extraction utilities (#20) — additional
ngr_str_*parsing primitives for structured text.
Browse open issues for the current backlog.
