Counts and computes the percent of interviews by angler zip code of origin. NA zip codes appear as an explicit "Unknown" row. Percent denominator is total interviews including NA rows.
Arguments
- design
A
creel_designobject with interviews attached viaadd_interviews.- zip_col
Name of the interview column holding the angler zip code. Defaults to
"zip_code". Name whatever your source calls it – no organisation's raw field name is assumed.
Value
A data.frame with class
c("creel_summary_zip", "data.frame") and columns:
zip_code (character), n (integer), pct (numeric,
1 decimal). NA zip codes appear as "Unknown". Percent denominator
is total interviews including NA.
Details
Interview-based summary, not pressure-weighted. NA zip codes appear as an
explicit "Unknown" row for data quality visibility. Sort order: "Unknown"
last; remaining rows sorted by n descending.
See also
Other "Reporting & Diagnostics":
adjust_nonresponse(),
check_completeness(),
compare_variance(),
flag_outliers(),
season_summary(),
standardize_species(),
summarize_boat_composition(),
summarize_by_angler_type(),
summarize_by_county(),
summarize_by_day_type(),
summarize_by_method(),
summarize_by_species_sought(),
summarize_by_trip_length(),
summarize_cws_rates(),
summarize_hws_rates(),
summarize_length_freq(),
summarize_refusals(),
summarize_successful_parties(),
summarize_trips(),
summary.creel_estimates(),
tidy.creel_estimates(),
validate_creel_data(),
validate_design(),
validate_incomplete_trips(),
validation_report(),
write_estimates()
Examples
data(example_calendar, package = "tidycreel")
data(example_interviews, package = "tidycreel")
example_interviews$zip_code <- rep_len(
c("68502", "68502", NA, "68508", NA),
nrow(example_interviews)
)
d <- suppressWarnings(
creel_design(example_calendar, date = date, strata = day_type)
)
d <- suppressWarnings(
add_interviews(d, example_interviews,
catch = catch_total, effort = hours_fished, harvest = catch_kept,
trip_status = trip_status, trip_duration = trip_duration,
angler_type = angler_type, angler_method = angler_method,
species_sought = species_sought, n_anglers = n_anglers, refused = refused
)
)
#> ℹ Added 22 interviews: 17 complete (77%), 5 incomplete (23%)
summarize_by_zip(d)
#> zip_code n pct
#> 1 68502 10 45.5
#> 2 68508 4 18.2
#> 3 Unknown 8 36.4
