Content of review 1, reviewed on June 05, 2024
I am the data editor on this manuscript. Based on the data/code policy of Ecology Letters, the figshare repository contains all the required files. There are some things I would encourage the authors to think about, as well as a couple of stumbling blocks I hit when trying to reproduce the analyses in the manuscript (note that this is currently not required for Ecology Letters, but is hopefully something others will do, so perhaps this is a nice check?).
Use of the xlsx files is alright, but this is not a text readable file (it's essentially binary, if I understand correctly). This is likely fine, but generally it is better for long-term reproducibility to have data files as text. The authors might consider outputting the xlsx files to csv or tsv to maintain potentially much longer-term access to the source data.
some small notes as I ran through bits of the code
seasonalrates
does not have a column in it called summer
, though this variable is referenced 58 times in the text, so I was unable to reproduce Figure 1.
There are some places where I think the authors may want to remove NAs, but do not in the code. For instance, the number of divorces estimated per period in the seasonalrates
data.frame creation.
{r}
tmp <- partnerships[which(partnerships$PeriodStart == as.Date("1997-07-01")),]
tmp$divorce
Only 2 of those values are NA, but using the sum without na.rm=TRUE
will output NA for that whole thing. Is this the behavior the authors intended? This information is used in later analyses to calculate some things used in the final plots. I may just be missing something though.
Source
© 2024 the Reviewer.
Content of review 2, reviewed on June 10, 2024
I thank the authors for their efforts on the code and data. The updated figshare repo looks great. A couple of small things that came to my attention. The csv change is really nice, and I thank the authors for taking my advice there. The R code though is still looking for a file with a .xlsx extension. Small change there. I was a bit surprised to see that the divorce rate plot didn't change when those NAs were removed for the calculation of divorcerate. But that's good news. I was unable to reproduce the widowrate plot though as it is in the main text. This could be an error on my end, as I kept hitting errors that stopped me from going further in the analysis. Some of those errors are copied below, but I did not even get to the model fitting or anything. This is fine though. This is not a requirement for Ecology Letters data/code availability. I would encourage the authors to do one last runthrough of their code and analyses just to make sure that manuscript plots are updated and all analyses match the manuscript.
Couple of errors
Error in s.nonwidows[, c("partnership\_year\_cat", "BrF\_age", "density", "TQextr",
"BrM\_age", "BrM\_massextr", "BrM\_tarsextr", "BrF\_massextr", "BrF\_tarsextr",
"ASR")]
:
! Can't subset columns that don't exist.
✖ Columns BrM\_tarsextr
and BrF\_tarsextr
don't exist.
line 133:
Error in select()
:
! Can't select columns that don't exist.
✖ Column BrM\_stay
doesn't exist.
line 146:
Error in select()
:
! Can't select columns that don't exist.
✖ Column BrM\_stay
doesn't exist.
I couldn't get the plots to work with the continuous color scale applied to discrete variable. I changed it to the following code just to see if these plots match up with the manuscript plots. The divorce rate one does, but the widowing one does not. I'd encourage the authors to see if there's anything there, and to re-run their analyses from the start just to make sure that nothing is changed and that all figures are up to date.
```{r}
plot divorcerates
divorceratesplot <- ggplot(seasonalrates) +
geom_point(aes(x=as.Date(PeriodStart), y = divorcerate, colour = summer), size =1.52) +
theme_classic() +
theme(axis.text.x = element_text(angle=45, vjust = 0.5),
legend.position = c(0.8,0.8))+
#scale_color_viridis(name = "Breeding season", begin = 0, end = 0.8, na.translate = F, discrete=TRUE, labels=c('Minor', 'Major')) +
scale_y_continuous(name="Divorce rate", limits=c(0, 0.5), breaks=seq(0,0.5,0.05)) +
scale_x_date(name="Season",date_breaks = "year", date_labels = "%Y")
divorceratesplot
plot widowrates
widowratesplot <- ggplot(seasonalrates) +
geom_point(aes(x=as.Date(PeriodStart), y = widowrate, colour = summer), size = 1.5) +
theme_classic() +
theme(axis.text.x = element_text(angle=45, vjust = 0.5),
legend.position = 'none')+
#scale_color_viridis(name = "Breeding season", begin = 0, end = 0.8, na.translate = F, labels=c('Minor', 'Major')) +
scale_y_continuous(name="Widowing rate", limits=c(0, 0.5), breaks=seq(0,0.6,0.05)) +
scale_x_date(name="Season",date_breaks = "year", date_labels = "%Y")
widowratesplot
```
Source
© 2024 the Reviewer.
Content of review 3, reviewed on June 12, 2024
Thank you to the authors for running through the code and making sure the final figures are representative of the corrected analyses. Everything looks good and I look forward to seeing this manuscript in print.
Source
© 2024 the Reviewer.
References
D., S. F. J., Terry, B., Jan, K., S., R. D., L., D. H. 2024. Causes and consequences of divorce in a long-lived socially monogamous bird. Ecology Letters.