Skip to content

Commit

Permalink
Add commented code comparing hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
seananderson committed Jul 3, 2024
1 parent d47a459 commit 642a331
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions data-raw/iphc-compare.R
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,25 @@ dir.create("data-raw/figs", showWarnings = FALSE)
ggsave('data-raw/figs/iphc-compare.pdf', width = 12, height = 15)
ggsave('data-raw/figs/iphc-compare.png', width = 12, height = 15)

# ## hook counts
# raw_d |>
# group_by(year, station, stlkey, sample_type, hooks_observed) |>
# summarise(gfdata = sum(number_observed), .groups = "drop") |>
# filter(sample_type == "all hooks") |>
# tidyr::pivot_longer(cols = c(hooks_observed, gfdata), names_to = "source") |>
# mutate(source = gsub("hooks_observed", "GFBio/gfiphc", source)) |>
# mutate(source = gsub("gfdata", "IPHC website/gfdata", source)) |>
# group_by(year, source) |> summarise(value = sum(value, na.rm = TRUE)) |>
# ggplot(aes(year, value, colour = source)) + geom_line() + geom_point(pch = 21) +
# scale_colour_manual(values = c("grey40", brewer.pal(6, "Reds")[4])) +
# gfplot::theme_pbs() + labs(colour = "Source") +
# ylab("Hooks observed") + xlab("Year") +
# scale_x_continuous(breaks = seq(2000, 2025, 2)) +
# ylim(0, NA) +
# theme(legend.position = "inside", legend.position.inside = c(0.2, 0.25))
# ggsave("data-raw/figs/iphc-hooks-observed-compare.pdf", width = 5, height = 3)
# ggsave("data-raw/figs/iphc-hooks-observed-compare.png", width = 5, height = 3)

# Get proportional difference by species
diff_df <- test2 |>
pivot_wider(names_from = source, values_from = count) |>
Expand Down

0 comments on commit 642a331

Please sign in to comment.