Commit 9cef99e0 authored by LDalby's avatar LDalby
Browse files

Use the median number per day for all seasons in the default bird numbers runs to standardize

parent 5ef4e74e
......@@ -26,8 +26,6 @@ date_stamp <- "2019-01-04"
Document compiled: `r Sys.time()`
```{r read-results, echo=FALSE}
current <- path_desktop("goose", date_stamp)
dir_ls(current, glob = "*.out") %>%
......@@ -55,12 +53,12 @@ path_desktop("goose", date_stamp, jobs, default_numbers_file) %>%
greylag = gl_families + gl_non_breeders,
barnacle = bn_families + bn_non_breeders,
day = day - 365L) %>%
filter(param == "GOOSE_STARTNO_SCALER",
value == 1,
season == 1) %>%
filter(value == 1) %>%
select(day, pinkfoot, greylag, barnacle) %>%
gather(key = species, value = numbers, -day) %>%
filter(numbers > 0) -> default_numbers
filter(numbers > 0) %>%
group_by(day, species) %>%
summarise(numbers = median(numbers)) -> default_numbers
# Summarize field forage data ----
# Mean numbers per day
......@@ -78,7 +76,12 @@ goose_numbers %>%
filter(numbers > 0) -> numbers_per_day
# Read the default numbers and standardize
left_join(numbers_per_day, default_numbers,
default_numbers %>%
mutate(species = case_when(species == "pinkfoot" ~ "pinkfoot_daily_avg",
species == "greylag" ~ "greylag_daily_avg",
species == "barnacle" ~ "barnacle_daily_avg",
TRUE ~ species)) %>%
left_join(numbers_per_day, .,
by = c("day", "species"),
suffix = c("", "_default")) %>%
mutate(standarized = numbers/numbers_default) -> numbers_per_day
......@@ -90,11 +93,11 @@ numbers_per_day %>%
species == goose_sp) %>%
ggplot(aes(day, standarized)) +
geom_line(aes(color = factor(value))) +
scale_color_viridis_d(name = "Barnacle scaler") +
scale_color_brewer(palette = "Set3", name = "Barnacle scaler") +
hrbrthemes::theme_ipsum_rc(axis_title_size = 12) +
labs(title = "Daily average numbers",
subtitle = "Pinkfeet numbers as a function of barnacle numbers",
caption = "Numbers are average of 10 consecutive seasons",
caption = "Numbers are average of 3 consecutive seasons",
y = "proportion of default numbers") +
facet_grid(~grain_dist)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment