diff --git a/NEWS b/NEWS index 206550d..2c8eae3 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,8 @@ Changes in Version 1.7.0 o Added the option to run a structural change test before running bfastlite() with two parameters: 'level' and 'type', equivalent to bfast() except that anything equal to or below 0 in 'level' will skip the sctest. + + o Fixed a bug where bfastpp() would throw an error when annual data is input. Changes in Version 1.6.1 diff --git a/R/bfastpp.R b/R/bfastpp.R index a59efb1..43cf0cd 100644 --- a/R/bfastpp.R +++ b/R/bfastpp.R @@ -107,11 +107,13 @@ bfastpp<- function(data, order = 3, } ## data with trend and season factor + seasonfreq <- if (sbins > 1) sbins else frequency(y)*sbins + rval <- data.frame( time = as.numeric(time(y)), response = y, trend = 1:NROW(y), - season = cut(cycle(y), if (sbins > 1) sbins else frequency(y)*sbins, ordered_result = TRUE) + season = if (seasonfreq > 1) cut(cycle(y), seasonfreq, ordered_result = TRUE) else factor("no seasonality") ) ## set up harmonic trend matrix as well