Goal
The exported function set. Imports: tibble and utils. jsonlite, desc, cffr, gh and writexl live in Suggests or Config/Needs/harvest because only data-raw/ and the tests use them. No tidyverse package in Imports.
Rewritten 2026-09-04 per dev/decisions-2026-09.md. Start from R/owd_accessors.R, R/owd_search.R, R/owd_install.R, R/catalog.R and R/zzz.R on the closed PR #15 branch, minus the refresh and cache code.
Functions
owd_packages(published = NULL): the packages tibble; TRUE keeps published packages, FALSE the rest, NULL all
owd_datasets(pkg = NULL): datasets tibble, optionally filtered by package
owd_variables(pkg = NULL, dataset = NULL): variables tibble
owd_search(query, fields = c("title", "description", "variable_name", "dataset_name")): case-insensitive regex over a prebuilt flat index; returns pkg_name, match_type (package, dataset, variable), dataset_name, field, text
owd_install(pkg = NULL, ...): install.packages(pkg, repos = c("https://openwashdata.r-universe.dev", "https://cloud.r-project.org"), ...); pkg = NULL installs all published packages after an interactive confirmation showing the count and errors in non-interactive sessions
The catalog is the internal owd_catalog object from R/sysdata.rda, read through one internal accessor so the tables can only come from one place.
Attach behaviour
library(owdata) attaches nothing else. .onAttach() prints one packageStartupMessage(): "owdata catalog: 30 published packages, 48 datasets, 2676 variables (harvested 2026-09-08). Try owd_search(), owd_packages(), owd_install()." The harvest date is the staleness signal; there is no refresh function and no cache.
Acceptance criteria
- Roxygen with examples for every export; the column reference for each table lives in the roxygen of its accessor
devtools::check() clean
- A behavioural test per export; every
expect_error() names its message
owd_search("groundwater") and owd_search("sanitation") return sensible hits
Goal
The exported function set. Imports: tibble and utils. jsonlite, desc, cffr, gh and writexl live in Suggests or
Config/Needs/harvestbecause onlydata-raw/and the tests use them. No tidyverse package in Imports.Rewritten 2026-09-04 per dev/decisions-2026-09.md. Start from
R/owd_accessors.R,R/owd_search.R,R/owd_install.R,R/catalog.RandR/zzz.Ron the closed PR #15 branch, minus the refresh and cache code.Functions
owd_packages(published = NULL): the packages tibble;TRUEkeeps published packages,FALSEthe rest,NULLallowd_datasets(pkg = NULL): datasets tibble, optionally filtered by packageowd_variables(pkg = NULL, dataset = NULL): variables tibbleowd_search(query, fields = c("title", "description", "variable_name", "dataset_name")): case-insensitive regex over a prebuilt flat index; returns pkg_name, match_type (package, dataset, variable), dataset_name, field, textowd_install(pkg = NULL, ...):install.packages(pkg, repos = c("https://openwashdata.r-universe.dev", "https://cloud.r-project.org"), ...);pkg = NULLinstalls all published packages after an interactive confirmation showing the count and errors in non-interactive sessionsThe catalog is the internal
owd_catalogobject fromR/sysdata.rda, read through one internal accessor so the tables can only come from one place.Attach behaviour
library(owdata)attaches nothing else..onAttach()prints onepackageStartupMessage(): "owdata catalog: 30 published packages, 48 datasets, 2676 variables (harvested 2026-09-08). Try owd_search(), owd_packages(), owd_install()." The harvest date is the staleness signal; there is no refresh function and no cache.Acceptance criteria
devtools::check()cleanexpect_error()names its messageowd_search("groundwater")andowd_search("sanitation")return sensible hits