SugiharaLab/rEDM

typo in code for indicating separations between plots?

Closed this issue · 1 comments

I think it's including one extra element in each individual time series because it selects the biggest year + the next point of the next time series... AKA I think this:

for(i in 2:nrow(composite_ts)) {
if(composite_ts$year[i] < composite_ts$year[i-1]) {
segments <- rbind(segments, c(startpos, i))
startpos <- i+1
}
}

should instead be:

for(i in 1:(nrow(composite_ts)-1)) {
if(composite_ts$year[i] > composite_ts$year[i+1]) {
segments <- rbind(segments, c(startpos, i))
startpos <- i+1
}
}

ha0ye commented

Ahhh, I think you may be right. Can you submit a pull request for the fix?