Every warning tidycreel raises has a class, so one warning can be handled
in one call without silencing the others. Each carries its own class,
creel_warning_<fact>, and the parent class creel_warning. A fact raised
in several places has one class wherever it is raised.
Handle one warning for one call with withCallingHandlers():
withCallingHandlers(
estimate_catch_rate(design),
creel_warning_mor_truncation = function(w) invokeRestart("muffleWarning")
)Prefer this to suppressWarnings(), which also hides the warnings that
mean an estimate may be wrong: missing period length, rate and effort in
different units, sections or cells left out of a total. Errors have a
matching family, creel_error_*.
Two classes were renamed to this pattern and keep their old names as well:
creel_warn_two_phase_rescale and creel_warn_tost_degenerate.
Information that is not a warning (tier 3) is raised as a message, with a
class from the matching family creel_message_<fact> and the parent
creel_message; see the Messages section below.
Tiers
Each entry starts with its tier, which get_warnings() also reports:
- Tier 1
The estimate may be wrong.
- Tier 2
Data quality or precision: worth a look.
- Tier 3
Information, raised as a message rather than a warning.
Every warning and tier-3 message is also recorded on the design or estimate
the call returns; get_warnings() lists them.
Tier 1 warnings print on every call. Tier 2 warnings print once per design:
the first time one is raised on a design it prints, and later repeats on
that design are recorded but not printed. A design is new each time
creel_design(), an add_*() step or adjust_nonresponse() returns it,
so new data print again. Three facts about the design also print once per
design although their tier is not 2: creel_warning_no_period_length,
creel_warning_pooled_domain_mix and the message
creel_message_internal_svydesign. Other tier-3 messages print on
every call.
Units and scale
creel_warning_no_period_lengthTier 1. Instantaneous counts were expanded without a period length, so effort is the counts summed over days (angler-days for an angler count), not angler-hours.
creel_warning_no_party_sizeTier 1. No party size was given, so each interview counts as one angler. If interviews are parties, rates are per party-hour, not per angler-hour.
creel_warning_unit_mismatchTier 1. A rate and an effort may be in different units (party-hours and angler-hours), so their product may not be a total in fish.
creel_warning_camera_unit_ambiguousTier 1. Camera ratio calibration cannot tell angler-hours from party-hours.
creel_warning_catch_is_stratum_totalTier 1. A catch total supplied to an exploitation rate is a stratum total.
creel_warning_p_period_coverageTier 1. The period lengths divided by
p_periodadd to more than 24 hours a day; the period lengths may already include the probability, which would then be applied twice.creel_warning_p_period_inferredTier 1. A schedule had periods but no
p_periodcolumn, so the period sampling probability was inferred.
What an estimate covers
creel_warning_missing_sectionsTier 1. One or more sections are missing from the count or interview data and are not in the estimate.
creel_warning_missing_rate_strataTier 1. Effort cells with no catch rate were left out of a total.
creel_warning_pooled_domain_mixTier 1. A total pools over domains the counts do not classify.
creel_warning_zero_catch_excludedTier 1. Trips that caught none of a species were left out, so the rate is among trips that caught it.
creel_warning_effort_excludedTier 2. Interviews with missing or zero effort were left out of a rate.
creel_warning_harvest_excludedTier 2. Interviews with missing harvest were left out of a harvest rate.
creel_warning_trip_duration_excludedTier 2. Interviews with a missing or non-positive trip duration were left out.
creel_warning_mor_truncationTier 2. 10 percent or more of incomplete trips were shorter than
truncate_atand left out of a mean-of-ratios rate (below 10 percent this is a message).creel_warning_two_phase_rescaleTier 1. Two-phase totals were rescaled onto the reported catch.
creel_warning_asymmetric_coverageTier 1. Count frames in a hybrid design cover different date-stratum cells.
Estimates that cannot be computed or may be unreliable
creel_warning_all_counts_naTier 1. Every value in the count column is
NA.creel_warning_zero_fish_totalTier 1. The estimated number of fish is zero or negative, so a mean or proportion cannot be computed.
creel_warning_no_recapturesTier 1. No tagged fish were recovered, overall or in a stratum, so the exploitation rate is estimated as 0.
creel_warning_exploitation_out_of_rangeTier 1. The exploitation rate is outside 0 to 1; its interval is clamped.
creel_warning_estimator_failedTier 1. One of the estimators being compared failed.
creel_warning_imputation_convergenceTier 1. The camera-count imputation model did not converge in a stratum.
Standard errors and intervals
creel_warning_bootstrap_ignores_strataTier 1. A bootstrap SE does not resample within the design strata.
creel_warning_bin_vcov_unavailableTier 1. Covariance between length bins is unavailable, so bins are treated as independent.
creel_warning_expansion_structure_unknownTier 1. Party-size expansion groups straddle the estimation cells unevenly, so the SE of the total cannot be combined from per-cell components.
creel_warning_section_covariance_invalidTier 1. The sections' day samples overlap too unevenly for their effort covariances to form a valid variance, so a sectioned total's lake-wide SE and the sections' share SEs are NA.
creel_warning_trip_length_se_undefinedTier 2. Too few trip durations to give an SE for the mean trip length.
creel_warning_single_interview_strataTier 2. Some strata have one interview, so their SE is undefined.
creel_warning_single_day_strataTier 2. Some strata have one sampled day, so their variance cannot be estimated.
creel_warning_camera_single_dayTier 2. A stratum has one paired interview/count day, so its camera calibration SE is
NA.creel_warning_schnabel_ci_upper_unboundedTier 2. Too few recaptures for a finite Schnabel Poisson upper limit;
ci_upperis a continuous-Poisson stand-in, not a measured bound.creel_warning_tost_degenerateTier 2. Too few degrees of freedom to test equivalence of complete and incomplete trips.
creel_warning_se_divergenceTier 2. Variance methods disagree by more than the threshold.
Sample size
creel_warning_small_sampleTier 2. Few interviews behind a rate, overall or in some groups.
creel_warning_thin_rate_cellsTier 2. Rate cells in a total rest on few trips.
creel_warning_sparse_strataTier 2. Strata have fewer than three counts or interviews.
creel_warning_sparse_groupsTier 2. Groups in a
bybreakdown have fewer than three observations.creel_warning_regression_small_groupTier 2. A group has fewer than three interviews for regression CPUE.
creel_warning_low_complete_pctTier 2. Few interviews are complete trips.
creel_warning_low_response_rateTier 2. Response rate below 50 percent in some strata.
Data checks
creel_warning_count_validationTier 2. Count data failed a check and estimation continued.
creel_warning_interview_validationTier 2. Interview data failed a check and estimation continued.
creel_warning_repeated_sampling_unitsTier 1. Counts have repeated sampling units with no count time to tell them apart.
creel_warning_negative_countsTier 2. The count column has negative values.
creel_warning_negative_catchTier 2. Interviews have negative catch.
creel_warning_negative_effortTier 2. Interviews have negative effort.
creel_warning_missing_effortTier 2. Interviews have missing effort.
creel_warning_short_tripsTier 2. Interviews have effort under six minutes.
creel_warning_long_trip_durationTier 2. Trip durations over 48 hours.
creel_warning_counted_not_interviewedTier 2. Parties were counted but none interviewed.
creel_warning_party_size_missingTier 2. Party size has missing values.
creel_warning_party_size_fractionalTier 2. Party size has non-integer values.
creel_warning_release_count_fractionalTier 2. A release count has non-integer values.
creel_warning_catch_unreconciledTier 2. Harvested plus released is less than caught for some species-interview pairs.
creel_warning_camera_negative_durationTier 2. Camera ingress-egress pairs with negative duration were dropped.
creel_warning_camera_imputed_countsTier 2. Some camera counts were imputed.
creel_warning_camera_na_countsTier 2. Some camera counts are
NA.creel_warning_high_missingnessTier 2. High missingness in camera counts in some strata.
creel_warning_dates_coerced_naTier 1. Some dates could not be parsed and became
NA.creel_warning_species_unmatchedTier 2. Some species values match no known species.
creel_warning_unknown_label_collisionTier 1. A column holds both unrecorded values and the literal label used for them.
creel_warning_catch_totals_divergeTier 2. Catch-table totals differ from the interview catch column.
Arguments and calls
creel_warning_circuit_time_ignoredTier 1.
circuit_timewas given for instantaneous counts and is ignored; if the counts are progressive, effort is computed the wrong way.creel_warning_design_type_mismatchTier 1. The design is not the type this function expects.
creel_warning_fragile_scheduleTier 2. Special-period declarations produced a fragile schedule.
Messages (tier 3)
Information is raised as a message, not a warning. Each carries its own
class, creel_message_<fact>, and the parent class creel_message, and is
recorded like a warning, with tier 3. Silence one for one call with
invokeRestart("muffleMessage") in a creel_message_<fact> handler.
creel_message_argument_ignoredTier 3. An argument has no effect in this call.
creel_message_day_type_from_stratumTier 3. A stratum column is used as the day type.
creel_message_high_zero_catchTier 3. A high share of trips caught nothing, overall or of a species.
creel_message_internal_svydesignTier 3. The internal survey design was accessed; changing it can give wrong variances.
creel_message_large_delta_pctTier 3.
delta_pctlooks like a percentage given as a whole number.creel_message_mor_incomplete_tripsTier 3. A rate uses the mean-of-ratios estimator on incomplete trips; complete trips are preferred where available.
creel_message_no_subdesignsTier 3. No survey sub-designs were found to adjust.
creel_message_nonstandard_estimatorTier 3. An unusual combination of
use_tripsandestimatorwas requested.creel_message_species_column_missingTier 3. The species column is missing, so the species coverage check was skipped.
creel_message_truncation_disabledTier 3.
truncate_at = NULLturned short-trip truncation off.creel_message_truncation_skippedTier 3. Mean-of-ratios truncation was not applied because the design has no trip duration.
creel_message_zero_countsTier 3. The count column has zeros.
creel_message_within_day_independentTier 3. Some units on a day were not counted at the same known occasions, so their within-day components are added as independent.
