creel_schema() constructs a creel_schema S3 object that maps canonical
tidycreel column names to actual column and table names in a data source.
The schema is the full connection contract consumed by creel_connect() and
fetch_*() functions in the tidycreel.connect companion package.
Construction is permissive — all column arguments default to NULL. Use
validate_creel_schema() to check that required columns for the given
survey type are mapped.
Usage
creel_schema(
survey_type = c("instantaneous", "bus_route", "ice", "camera", "aerial"),
interviews_table = NULL,
counts_table = NULL,
catch_table = NULL,
lengths_table = NULL,
date_col = NULL,
catch_col = NULL,
effort_col = NULL,
trip_status_col = NULL,
count_col = NULL,
catch_uid_col = NULL,
interview_uid_col = NULL,
species_col = NULL,
catch_count_col = NULL,
catch_type_col = NULL,
length_uid_col = NULL,
length_mm_col = NULL,
length_type_col = NULL,
harvest_col = NULL,
trip_duration_col = NULL,
trip_start_col = NULL,
interview_time_col = NULL,
n_anglers_col = NULL,
n_counted_col = NULL,
n_interviewed_col = NULL,
angler_type_col = NULL,
angler_method_col = NULL,
species_sought_col = NULL,
refused_col = NULL
)Arguments
- survey_type
Survey type. One of
"instantaneous","bus_route","ice","camera", or"aerial". Validated at construction viamatch.arg().- interviews_table
Name of the interviews table in the data source.
- counts_table
Name of the counts table in the data source.
- catch_table
Name of the catch table in the data source.
- lengths_table
Name of the lengths table in the data source.
- date_col
Column name for survey date.
- catch_col
Column name for catch count in interviews.
- effort_col
Column name for effort (hours) in interviews.
- trip_status_col
Column name for trip status in interviews.
- count_col
Column name for angler count in counts.
- catch_uid_col
Column name for catch unique identifier.
- interview_uid_col
Column name for interview unique identifier.
- species_col
Column name for species.
- catch_count_col
Column name for catch count in the catch table.
- catch_type_col
Column name for catch type (harvest/release).
- length_uid_col
Column name for length unique identifier.
- length_mm_col
Column name for fish length (mm).
- length_type_col
Column name for length type.
- harvest_col
Column name for harvest count.
- trip_duration_col
Column name for trip duration.
- trip_start_col
Column name for trip start time.
- interview_time_col
Column name for interview time.
- n_anglers_col
Column name for number of anglers.
- n_counted_col
Column name for number of anglers counted.
- n_interviewed_col
Column name for number of anglers interviewed.
- angler_type_col
Column name for angler type.
- angler_method_col
Column name for fishing method.
- species_sought_col
Column name for target species.
- refused_col
Column name for refused interviews indicator.
See also
Other "Survey Design":
add_catch(),
add_counts(),
add_interviews(),
add_lengths(),
add_sections(),
as_hybrid_svydesign(),
as_survey_design(),
compute_angler_effort(),
compute_effort(),
creel_design(),
est_effort_camera(),
prep_counts_boat_party(),
prep_counts_daily_effort(),
prep_interview_catch(),
prep_interviews_trips(),
validate_creel_schema()
Examples
s <- creel_schema(
survey_type = "instantaneous",
interviews_table = "vwInterviews",
counts_table = "vwCounts",
date_col = "SurveyDate",
catch_col = "TotalCatch",
effort_col = "EffortHours",
trip_status_col = "TripStatus",
count_col = "AnglerCount"
)
print(s)
#> <creel_schema: instantaneous>
#>
#> ── interviews: vwInterviews ──
#>
#> date -> SurveyDate
#> catch -> TotalCatch
#> effort -> EffortHours
#> trip_status -> TripStatus
#>
#> ── counts: vwCounts ──
#>
#> count -> AnglerCount
