Giorgio Garziano
2016-Mar-31 12:59 UTC
[R] ts or xts with high-frequency data within a year
Ryan,>From "decompose()" source code, two conditions can trigger the error message:"time series has no or less than 2 periods" based on the frequency value, specifically: 1. f <= 1 2. length(na.omit(x)) < 2 * f It appears to me that your reproducible code has got a typo error, it should be: Z=ts(X[,3],frequency=24*365) I mean X[,3] in place of X[,2]. Further, frequency=24*365, 2*frequency > 6000 = length(X[,3]), and that triggers the second condition.>From R console:> decomposefunction (x, type = c("additive", "multiplicative"), filter = NULL) { type <- match.arg(type) l <- length(x) f <- frequency(x) if (f <= 1 || length(na.omit(x)) < 2 * f) stop("time series has no or less than 2 periods") -- Best, GG [[alternative HTML version deleted]]