You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This seems to be a floating point issue. On my computer, when end is not present and the row name is 2 as in the example, the function calculates it with 2 + 7/12 shown as 2.5833333. This is greater than the value from the tsp[2] 2.583333. When end is provided it is 2.583333 (the same as from tsp[2]).
For the x example 1999.583 is for both the tsp[2] and (1999 + 7/12).
If in window.default() we changed the check to something like (start > end & !all.equal(start, end, .001)) that would work for this case, but obviously has other implications.
Say we have a monthly time series starting from year 1998. We want to obtain the last value via window() function:
1998 1 2 3 4 5 6 7 8 9 10 11 12
1999 13 14 15 16 17 18 19 20
1999 20
which is equivalent of
1999 20
Now if we start the time series from A.D. 1,
Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
1 1 2 3 4 5 6 7 8 9 10 11 12
2 13 14 15 16 17 18 19 20
Aug
2 20
which is fine. But
Error in window.default(x, ...) : 'start' cannot be after 'end'
R version 3.5.2 (2018-12-20)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 9 (stretch)
Matrix products: default
BLAS/LAPACK: /usr/lib/x86_64-linux-gnu/libmkl_rt.so
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8
[4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.5.2
METADATA
The text was updated successfully, but these errors were encountered: