I have a time-series similar to the following and I want to calculate the annual trends with the greenbrown
package.
Everything was working perfectly a weeks ago, however, now, I get the following error :
mdata<-c(0.023972094, -0.008573375, 0.236974105 , 0.064463101, 0.143193305, 0.296787709 , 0.105294608, -0.024576377)
mdata_ts<-ts(mdata,frequency=1,start=c(0))
library(greenbrown)
library(bfast)
Trend(mdata_ts) # this gives the error
Error in cut.default(cycle(y), if (sbins > 1) sbins else frequency(y) * :
invalid number of intervals
I think the error is from bfast
package but I am not sure. I am on the latest RStudio version on Windows 10. The bfast
version is 1.6.1 and the greenbrown
is the version 2.4.3.
Can anyone help me?
Solved it by shitfting to the development version of package (in case anyone faces a similar issue) :
install_github("bfast2/strucchangeRcpp")
install_github("bfast2/bfast")