ReScience-Archives / Petchey-Plebani-Pennekamp-2016

[Re] Chaos in a long-term experiment with a plankton community, O. Petchey, M. Plebani, and F. Pennekamp, ReScience, volume 2, issue 1, 2016.
3 stars 5 forks source link

Problems trying to run the code #1

Open khinsen opened 7 years ago

khinsen commented 7 years ago

I tried to run your code following the instructions, without much success so far. Warning: I have next to no R experience, so I am really just stupidly following your instructions.

The first time I tried to run report.Rmd in RStudio, I got an error message telling me that package devtools is not installed. I installed it as I had installed the listed dependencies before. Could it be that this package is missing from your dependency list?

On the next run, I got an error reported in line 147: Error: sum(spp.abund$Day.number == 1 + as.numeric((spp.abund$Date - .... is not TRUE Execution halted. I have no idea what to do about that.

opetchey commented 5 years ago

Sorry to only now see this issue. Please let me know if it still needs attention.

sguyader commented 5 years ago

I've got the same issue as reported by @khinsen. I had to change the code line 147 of code\report.Rmd to make it work:

change stopifnot(sum(spp.abund$Day.number == 1+as.numeric((spp.abund$Date - spp.abund$Date[1]) / 24 / 60 / 60)) == length(spp.abund$Date))

to stopifnot(sum(spp.abund$Day.number == 1+as.numeric((spp.abund$Date - spp.abund$Date[1]))) == length(spp.abund$Date))

Edit: the same type of change, which consists in removing the divisions (/ 24 / 60 / 60) has to be made lines 164 and 169.

opetchey commented 5 years ago

Dear @sguyader Thanks very much for the fix. I guess this is due to some changes in how some of the date conversion functions that we use work. When I get a chance I'm going to see if there is a fix that can protect us against negative outcomes of such changes. (So will leave this issue open.) All the best Owen