Skip to contents

Multiplies per-trip effort (hours) by party size (number of anglers) to produce angler-hours. This converts party-level effort records to individual-angler units, which are required for CPUE and harvest-rate computations.

This function can be called standalone on a raw data frame or is called internally by add_interviews when constructing the design object.

Usage

compute_angler_effort(data, effort, n_anglers)

Arguments

data

A data frame containing the interview records.

effort

Tidy selector for the effort column (numeric, hours per trip).

n_anglers

Number of anglers in the party. Either a bare column name (e.g. n_anglers = party_size) or a single positive number stating a constant party size (e.g. n_anglers = 1 for individual-level interviews). A bare number is read as a party size, not as a tidyselect column position. Values must be positive and finite.

Value

The input data frame with an added .angler_effort column (numeric, angler-hours). Existing columns are preserved.

Examples

parties <- data.frame(effort = c(2.0, 3.0), n_anglers = c(2L, 3L))
compute_angler_effort(parties, effort, n_anglers)
#>   effort n_anglers .angler_effort
#> 1      2         2              4
#> 2      3         3              9