tidycreel.connect is a companion package that bridges tidycreel with relational and embedded database back-ends. It targets agencies and research groups that collect creel survey data through field applications or custom data entry systems and need a reproducible, validated path to get that data into a form that tidycreel can analyse.
The package focuses on three layers of the data pipeline that tidycreel itself deliberately leaves out of scope:
tidycreel.connect lives in a subdirectory of the tidycreel repository rather than a repository of its own, so both installers need to be told where to look:
# Using remotes
remotes::install_github("chrischizinski/tidycreel", subdir = "tidycreel.connect")
# Or using pak
pak::pak("chrischizinski/tidycreel/tidycreel.connect")It is not on CRAN, and it requires tidycreel 7.0.0 or newer: identifier columns are normalised to character on both sides of the boundary, so an older tidycreel would hand the design numeric ids for the same survey.
tidycreel handles design, estimation, and reporting:
building a creel_design object, running effort and catch
estimators, producing publication-ready plots and tables.
tidycreel.connect handles the data-ingestion and storage layer that feeds it: connecting to a field database or API, loading validated data frames, and handing them off to tidycreel estimation functions.
The two packages are designed to work together but can be used independently:
A typical integrated workflow looks like this:
library(tidycreel)
library(tidycreel.connect)
# 1. Connect to a DBI-backed database (SQL Server, DuckDB, SQLite)
con <- creel_connect(dbi_connection, schema = "creel")
# -- or connect using a YAML configuration file --
con <- creel_connect_from_yaml("config/creel.yml")
# 2. Discover available surveys (API connections only)
list_creels(con)
search_creels(con, keyword = "2025")
# 3. Load validated data and hand off to tidycreel
counts <- fetch_counts(con)
interviews <- fetch_interviews(con)
design <- creel_design(counts = counts, ...) |>
add_interviews(interviews)
estimate_effort(design)creel_connect(con, schema) — opens a
creel_connection object backed by a DBI connection (SQL
Server, DuckDB, SQLite) or a named list of CSV file paths.creel_connect_api(...) — opens a
creel_connection to a REST API endpoint.creel_connect_from_yaml(path, config = "default") —
convenience wrapper that reads connection parameters from a YAML file;
supports environment variable injection for credentials.creel_check_driver(con) — validates that the underlying
DBI driver is supported; useful for pre-flight checks in automated
pipelines.These functions use S3 dispatch so they work identically across DBI, CSV, and API back-ends. Each renames raw fields to canonical tidycreel column names and coerces data types at import time.
fetch_counts(conn, ...) — loads survey count records
(bank anglers, angler boats, non-angler boats) into a data frame ready
for creel_design().fetch_interviews(conn, ...) — loads interview records
including IDs, dates, catch counts, effort, and trip status.fetch_catch(conn, ...) — loads catch detail records
associated with interviews; species codes are coerced to character.fetch_harvest_lengths(conn, ...) — loads fish length
measurements for harvested fish, injecting
length_type = "harvest".fetch_release_lengths(conn, ...) — loads fish length
measurements for released fish, injecting
length_type = "release".list_creels(conn, ...) — returns a data frame of all
available surveys on the connected API, with UIDs, titles, descriptions,
and active status.search_creels(conn, keyword, ...) — client-side filter
of list_creels() output; matches keyword (case-insensitive)
against title and description fields.tidycreel.connect also supports a pure-CSV workflow for users who
store survey data as flat files rather than in a database. Pass a named
list of file paths to creel_connect():
chrischizinski/tidycreel,
under tidycreel.connect/