Skip to contents

autoplot.creel_estimates() produces a point-and-errorbar plot from a creel_estimates object. For ungrouped estimates a single point with confidence interval is shown. For grouped estimates (when by was supplied to the estimation function) each group level gets its own point, colour-coded and positioned along the x-axis.

Returns a ggplot2 object, which the package imports, so nothing extra needs installing.

Usage

# S3 method for class 'creel_estimates'
autoplot(object, title = NULL, theme = c("default", "creel"), ...)

Arguments

object

A creel_estimates object.

title

Optional character string for the plot title. Defaults to a human-readable description of the estimation method.

theme

Character string selecting the plot theme. Use "default" (default) for ggplot2::theme_bw(), or "creel" for theme_creel() and package-standard colours. Neither inherits a theme set with ggplot2::theme_set(); add your own with + if you need it.

...

Additional arguments (currently unused).

Value

A ggplot object.

Examples

data(example_calendar)
data(example_counts)
data(example_interviews)

design <- creel_design(example_calendar, date = date, strata = day_type)
design <- add_counts(design, example_counts)
#> Warning: No weights or probabilities supplied, assuming equal probability
design <- add_interviews(design, 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%)

est <- estimate_effort(design)
#> Warning: Instantaneous counts were expanded without a period length.
#>  No `period_length_col` was supplied to `add_counts()`, so the estimate is the
#>   count column summed over days.
#> ! If that column holds an instantaneous angler count, the result is in
#>   angler-days, not angler-hours.
#>  Supply the period each count was randomised within: `add_counts(design,
#>   counts, period_length_col = <col>)`.
#> This warning is displayed once per session.
ggplot2::autoplot(est)


est_grp <- estimate_effort(design, by = day_type)
ggplot2::autoplot(est_grp)