-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcomparing_estimates_dif_stratifications.R
72 lines (52 loc) · 1.84 KB
/
comparing_estimates_dif_stratifications.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
## Comparing Canadian trajectories between teh standard stratification
## and a latlong stratification
##
library(tidyverse)
inds_standard <- read_csv("website/BBS_Full_Indices_continent_country_2022.csv") %>%
filter(region == "Canada",
trend_time == "Long-term") %>%
select(species, region, year, index, index_q_0.05, index_q_0.95,
n_routes_total) %>%
mutate(stratification = "bbs_cws")
inds_latlong <- read_csv("data/lat_long_indices_composite_canada.csv") %>%
select(species, region, year, index, index_q_0.05, index_q_0.95,
n_routes_total) %>%
mutate(stratification = "latlong")
inds_all <- bind_rows(inds_standard,
inds_latlong)
inds_fy <- inds_all %>%
filter(year == 2022) %>%
group_by(species) %>%
summarise(n_mods = n())
species_sel <- c("Ovenbird",
"Red-eyed Vireo",
"Hermit Thrush",
"Veery",
"Canada Warbler",
"Black-capped Chickadee")
species_sel <- c("Blackpoll Warbler",
"Connecticut Warbler",
"Hermit Thrush",
"Tennessee Warbler",
"Canada Warbler",
"Cape May Warbler")
species_sel <- c("Chimney Swift",
"Tree Swallow",
"Red-winged Blackbird",
"Pied-billed Grebe",
"Green Heron",
"Bobolink")
inds_sel <- inds_all %>%
filter(species %in% species_sel,
year > 1969)
txt <- ggplot(data = inds_sel,
aes(x = year, y = index,
colour = stratification,
fill = stratification))+
geom_ribbon(aes(ymin = index_q_0.05,
ymax = index_q_0.95),
alpha = 0.3)+
geom_line()+
scale_y_continuous(transform = "log10")+
facet_wrap(vars(species))
txt