Skip to contents

Counts the number of interviews in each day type stratum (e.g., weekday, weekend) within each calendar month. The day type column is resolved from the design's strata: a stratum named day_type when the design declares one, otherwise the first stratum column, with a message when the design declares more than one. Pass day_type_col to state the column outright. An inferred column whose values each occur in a single month of the year (a composite stratum such as "04_weekday") is refused when at least two months each hold two or more of its values, since crossing it with month would produce a table of structural zeros. This is a heuristic on which values occur in which months: pass day_type_col to state the column outright.

Usage

summarize_by_day_type(design, day_type_col = NULL)

Arguments

design

A creel_design object with interviews attached.

day_type_col

Name of the column holding the day type, as a single string. When NULL (the default) it is resolved from the design's strata as described above.

Value

A data.frame with class c("creel_summary_day_type", "data.frame") and columns: month, day_type, N, percent.

Details

Interview-based summary, not pressure-weighted. This function tabulates raw interview records without applying survey weighting by sampling effort or effort stratum. For pressure-weighted extrapolated estimates, use estimate_catch_rate or estimate_harvest_rate.

Examples

data(example_calendar)
data(example_interviews)
d <- creel_design(example_calendar, date = date, strata = day_type)
d <- add_interviews(d, example_interviews,
  catch = catch_total, effort = hours_fished, harvest = catch_kept,
  trip_status = trip_status
)
#> Warning: ! No `n_anglers` provided — assuming 1 angler per interview.
#> ℹ Pass `n_anglers = <column>` to use actual party sizes for angler-hour
#>   normalization.
#> ℹ If the interviews really are one angler each, pass `n_anglers = 1` to state
#>   that and silence this warning.
#> ℹ Added 22 interviews: 17 complete (77%), 5 incomplete (23%)
summarize_by_day_type(d)
#>   month day_type  N percent
#> 1  June  weekday 13    59.1
#> 2  June  weekend  9    40.9