Skip to content

Commit cd6fb95

Browse files
committed
peer review updates
1 parent 5c7c265 commit cd6fb95

30 files changed

+1845
-2
lines changed

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,13 @@
55
.Rhistory
66
annual_abundance_changes/README.html
77
README.html
8+
results/lognormal_models/.DS_Store
9+
weather_variables/Cloud_scripts/.DS_Store
10+
plots/mam_raw/.DS_Store
11+
plots/chelsa_raw/.DS_Store
12+
plots/annual_abundance/annual_population_growth_rates/.DS_Store
13+
plots/annual_abundance/linear_trend_and_detrending/.DS_Store
14+
plots/annual_abundance/timeseries_gaps/.DS_Store
15+
plots/annual_abundance/timeseries_gaps/record_timelines/.DS_Store
16+
meta_regression/GAM_coefficients/.DS_Store
17+
data/.DS_Store

data/lifehistory.RData

3 Bytes
Binary file not shown.

lifehistory_exploration.R

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ options(width = 100)
1818

1919
library(tidyverse)
2020
library(patchwork)
21+
library(psych)
2122

2223
##__________________________________________________________________________________________________
2324
#### 1. Loading data ####
@@ -28,6 +29,9 @@ glimpse(mam_dski)
2829
load("../rawdata/mam_alhd.RData")
2930
glimpse(mam_alhd)
3031

32+
load("../rawdata/mam_comadre.RData")
33+
glimpse(mam_comadre)
34+
3135
##__________________________________________________________________________________________________
3236
#### 2. Summary of the DSKI data ####
3337

@@ -230,3 +234,40 @@ ggsave(bm_lon + bm_lit,
230234

231235
save(lifehistory, file = "data/lifehistory.RData")
232236

237+
##__________________________________________________________________________________________________
238+
#### 7. Combining with comadre data ####
239+
240+
# comadre at the species level
241+
mam_comadre_spp <- mam_comadre %>%
242+
group_by(gbif.species.id) %>%
243+
summarise(gbif.species = gbif.species[1],
244+
generation_time = mean(generation_time, na.rm = T),
245+
life_expectancy = mean(life_expectancy, na.rm = T),
246+
adult_survival = mean(adult_survival, na.rm = T)) %>%
247+
ungroup()
248+
249+
# combine
250+
lifehistory_all <- lifehistory %>%
251+
left_join(x = ., y = select(mam_comadre_spp, -2), by = "gbif.species.id")
252+
253+
# pairs plots
254+
lifehistory_complete <- lifehistory_all %>%
255+
na.omit() %>%
256+
mutate_at(.vars = 10:12, .funs = function(x){log(x + 1)}) %>%
257+
rename_all(.funs = str_to_sentence) %>%
258+
rename(`Generation time` = Generation_time,
259+
`Life expectancy` = Life_expectancy,
260+
`Adult survival` = Adult_survival)
261+
262+
jpeg("plots/lifehistory_raw/life_history_covariance.jpeg",
263+
width = 15, height = 15, units = "cm",res = 600)
264+
pairs.panels(lifehistory_complete[,7:12],
265+
ellipses = FALSE, lm = TRUE, method = "spearman")
266+
dev.off()
267+
268+
269+
270+
271+
272+
273+

0 commit comments

Comments
 (0)