From 5a6a9932aa7db44908487f28d20e06c4a6c7cd6c Mon Sep 17 00:00:00 2001 From: Gary Powney Date: Fri, 9 Jun 2023 21:53:43 +0100 Subject: [PATCH] fix(occurrenceChange): correct the growth rate function The growth rate function incorrectly used number of years rather than number of periods (in this case nyr-1). related to #251 --- R/occurrenceChange.r | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/occurrenceChange.r b/R/occurrenceChange.r index eefc7f9..8b7282b 100644 --- a/R/occurrenceChange.r +++ b/R/occurrenceChange.r @@ -170,7 +170,7 @@ occurrenceChange <- function(bayesOut, firstYear=NULL, lastYear=NULL, change = ' if(change == 'growthrate'){ - nyr <- length(years) + nyr <- length(years)-1 first <- years[1] last <- years[length(years)] res_tab <- data.frame(occ_it[, colnames(occ_it) == first],