jheare / OluridaSurvey2014

Raw data and R scripts for statistical analysis and figure creation
2 stars 2 forks source link

A few suggestions from a quick review #11

Closed benmarwick closed 9 years ago

benmarwick commented 9 years ago

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...

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


        ---
    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()
```


---
benmarwick commented 9 years ago

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.