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

Code changes needed #3

Open sguyader opened 5 years ago

sguyader commented 5 years ago

Here are some other changes needed to run the code:

  1. Lines 412 and 837 The detrended <- rbind(ww1, ww2) command produced a matrix, which can't be used by the group_by command in line 423. Instead of rbind, I suggest to use dplyr::bind_rows.
  2. Line 951 The fit_GAMs function called line 948 creates an object named X, not X1. Therefore, on line 951 we have to reflect this by changing Get_LE_from_fit2(gams, X1, epsval=0.01) to Get_LE_from_fit2(gams, X, epsval=0.01)
  3. Line 992 The command cors.long <- gather(cors, key=dist, convert=F) doesn't give the expected result, as the dist column is considered as one of the variables to be "gathered". As a result, the data frame we obtain has 2 columns, the first one labeled "dist" but containing the variables, and the second one containing the "values" but with the first 12 corresponding to the distance. The correct command should be gather(cors, 2:13, key=Variable, value=Correlation, convert=F)
rougier commented 5 years ago

Forwarded to @opetchey