This was really interesting to have a look at, thanks for sharing it. I was able to reproduce everything with minimal edits (changing my wd, commenting out some of the interactive bits, View, etc). I'll email my output since I'm not sure how to get at html file on here quickly. A few quick thoughts...
On the code...
The scripts could be prefixed with a number like 001-xxxx.R to indicate what the correct order should be
The entire ms. could be a R markdown file that sources the R scripts (I see you explored this with e temp plots, see below for another approach)
Most current style guides for R recommend spaces around operators to improve readability (=, +, etc)
Try dplyr instead of plyr, it feels a million times faster and has more intuitive syntax
Add package version numbers to the ms. and readme.md, I usually just paste in the output from sessionInfo
add a clickable DOI to the preprint into the readme.md to close the loop between paper and code. I see you've linked the title, but a DOI is more recognisable as a citable thing. Related, I'd specifically say "Cite as:..." before the citation, so people can see easy see how to give you credit for these things
On the figures...
Be more explicit about what code generates which figure, since the code generates more figs than are in the ms.
looks like fig 4 has had some post-processing to get labels on the plots, this could be done with R, like you did for fig 5
the code for figs 5-6-7 makes the plots appear in the reverse order to how they appear in the paper, which had me puzzled for a little while :)
looks like some post-processing on figs 8-9-10 to get the secondary y-axis title. But I'm not even sure if that's possible without a great deal of fiddling. I'm amazed you even got a second y-axis on there!
On the stats...
all the chi-sq tests match my output
I couldn't find any of the metric data or stats (SE, SD, CI) in the output. Can they be included in the scripts?
Below is a more self-contained approach, using an R Markdown file that sources the scripts (the scripts could simply be copy and pasted into the chunks). You wouldn't need to setwd for each script because the knitting process sets the wd to the location of the Rmd file (which is great for isolating the code execution from contaminating objects, etc).
This Rmd file works for me with your scripts with minor edits (I had to comment out a few lines here and there), and I can knit it to get all your figs at once. To make that possible, I'd have
a chuck at the top that sets all the chunk options so that echo=FALSE to suppress the code, cache=TRUE to keep things fast while iterating over it, and a few other tweaks to keep it tidy
a chunk that gets the wd to be one dir up so we can find the data files, In this case I changed my wd in each script file because I ran the scripts separately before making this Rmd file
a chunk to get numbered fig captions and cross-refs in the text.\
---
date: "Tuesday, December 16, 2014"
output: html_document
---
The narrative text can go in here and between the code chunks. Then you can knit the paper to PDF (or use `make`) and you've got a (more) easily reproducible paper.
```{r fig_2_and_3}
source("temperature-plots.R", print.eval = TRUE, echo = TRUE)
```{r fig_4}
source("Kaplan-meier-stats-plot-all.R", print.eval = TRUE, echo = TRUE)
```
```{r figs_5_6_7}
source("sizedist-stats-plot.R", print.eval = TRUE, echo = TRUE)
```
```{r fig_8}
source("percbrood-temp-plot-OysterBay.R", print.eval = TRUE, echo = TRUE)
```
```{r fig_9}
source("percbrood-temp-plot-Fidalgo.R", print.eval = TRUE,echo = TRUE)
```
```{r fig_10}
source("percbrood-temp-plot-Manchester.R", print.eval = TRUE, echo = TRUE)
```
Dependencies within R:
```{r}
# show package names and version numbers (not given in the paper)
sessionInfo()
```
Sorry, in the excitement of it all I somehow duplicated my issue post, not sure how that happened. The other one is up to date. Apparently it's impossible to delete issues, so I'll just close this one.
This was really interesting to have a look at, thanks for sharing it. I was able to reproduce everything with minimal edits (changing my wd, commenting out some of the interactive bits,
View
, etc). I'll email my output since I'm not sure how to get at html file on here quickly. A few quick thoughts...On the code...
dplyr
instead ofplyr
, it feels a million times faster and has more intuitive syntaxsessionInfo
On the figures...
On the stats...
Below is a more self-contained approach, using an R Markdown file that sources the scripts (the scripts could simply be copy and pasted into the chunks). You wouldn't need to
setwd
for each script because the knitting process sets the wd to the location of the Rmd file (which is great for isolating the code execution from contaminating objects, etc).This Rmd file works for me with your scripts with minor edits (I had to comment out a few lines here and there), and I can knit it to get all your figs at once. To make that possible, I'd have
echo=FALSE
to suppress the code,cache=TRUE
to keep things fast while iterating over it, and a few other tweaks to keep it tidy