library(tidyverse)
library(lubridate)
library(viridis)
library(MetBrewer)
library(treemapify)

# Write tibble names to list for function compatibility
tibblelist <-
  list(ref_data, daily, season) |> 
  set_names(c("all_seasons", "daily_records", "season_totals"))

# Read in the manually partyproofed daily data
party_proofed <- read_csv(params$partypath)

# Proof the daily data
daily_proofed <- proofHS(party_proofed, get(names(tibblelist[1])))
rm(party_proofed)

# Proof the season data
season_proofed <- proofHS(get(names(tibblelist[3])), get(names(tibblelist[1])))

Introduction

This is the r params$year survey analytics report for Harvest Survey online data. All of the visualizations below use proofed daily and/or season data.

Response lag

What is the distribution of response lag?

responselag(daily_proofed, type = "count")

What is the relationship between response lag and number of birds retrieved?

responselag(daily_proofed, type = "lag")

What is the relationship between response date and harvest date? Larger and darker circles indicate more birds retrieved. The dotted lines are guides to show (from top to bottom), a time lag of 0, 30, 60, 90, and 120 days.

responselag(daily_proofed, type = "date")

Retrieved birds by number of days hunted

In the daily data, what is the relationship between number of birds retrieved and number of days spent hunting?

bagdays(daily_proofed, output = "plot")
DT::datatable(bagdays(daily_proofed, output = "table"))

Harvest over time

Daily

daily_proofed |> 
  mutate(
    sp_group_estimated =
      ifelse(
        str_detect(sp_group_estimated, "Sea"),
        "Sea Ducks",
        sp_group_estimated)) |> 
  group_by(harvested_date, sp_group_estimated) |> 
  summarize(sum_daily_retrieved = sum(retrieved)) |> 
  ungroup() |> 
  ggplot(
    aes(x = harvested_date, y = sum_daily_retrieved, 
        color = sp_group_estimated, fill = sp_group_estimated)) + 
  geom_jitter(alpha = 0.3) +
  geom_line() +
  labs(x = "Date harvested", y = "Number of birds retrieved") +
  theme_classic() +
  theme(legend.position = "none") +
  scale_fill_manual(
    values = 
      met.brewer(
        "Hokusai3",
        length(unique(daily_proofed$sp_group_estimated)))) +
  scale_color_manual(
    values = 
      met.brewer(
        "Hokusai3",
        length(unique(daily_proofed$sp_group_estimated)))) +
  facet_wrap(~sp_group_estimated, ncol = 1) 

Weekly

daily_proofed |> 
  mutate(
    sp_group_estimated =
      ifelse(
        str_detect(sp_group_estimated, "Sea"),
        "Sea Ducks",
        sp_group_estimated)) |> 
  mutate(harvested_wk = lubridate::week(harvested_date)) |> 
  group_by(harvested_wk, sp_group_estimated) |> 
  summarize(sum_weekly_retrieved = sum(retrieved)) |> 
  ungroup() |> 
  ggplot(
    aes(x = harvested_wk, y = sum_weekly_retrieved, 
        color = sp_group_estimated, fill = sp_group_estimated)) + 
  geom_jitter(alpha = 0.3) +
  geom_line() +
  labs(x = "Week harvested", y = "Number of birds retrieved") +
  theme_classic() +
  theme(legend.position = "none") +
  scale_fill_manual(
    values = 
      met.brewer(
        "Hokusai3",
        length(unique(daily_proofed$sp_group_estimated)))) +
  scale_color_manual(
    values = 
      met.brewer(
        "Hokusai3",
        length(unique(daily_proofed$sp_group_estimated)))) +
  facet_wrap(~sp_group_estimated, ncol = 1) 


USFWS/migbirdMBHS documentation built on Feb. 20, 2024, 4:49 a.m.