Suharto Anggono Suharto Anggono
2013-Jan-28 07:54 UTC
[Rd] Minor issue in code of 'diffinv.vector' in R 2.15.2
In R 2.15.2 (and not before), in the definition of function 'diffinv.vector' in package stats, there is difference <- as.integer(differences) I believe differences <- as.integer(differences) is intended, because 'difference' is not referenced anywhere. However, without conversion of 'differences' to integer, 'diffinv.vector' in R 2.15.2 works OK. Also, to make 'differences' consistently integer, diffinv.vector(diffinv.vector(x, lag, differences-1, diff(xi, lag=lag, differences=1)), lag, 1, xi[1L:lag]) in the end part can be changed to diffinv.vector(diffinv.vector(x, lag, differences-1L, diff(xi, lag=lag, differences=1L)), lag, 1L, xi[1L:lag])
Martin Maechler
2013-Jan-28 10:44 UTC
[Rd] Minor issue in code of 'diffinv.vector' in R 2.15.2
>>>>> Suharto Anggono Suharto Anggono <suharto_anggono at yahoo.com> >>>>> on Sun, 27 Jan 2013 23:54:50 -0800 writes:> In R 2.15.2 (and not before), in the definition of > function 'diffinv.vector' in package stats, there is > difference <- as.integer(differences) > I believe > differences <- as.integer(differences) > is intended, because 'difference' is not referenced > anywhere. However, without conversion of 'differences' to > integer, 'diffinv.vector' in R 2.15.2 works OK. Thank you, Suharto, you are right... about the typo above, the tweaks below, *and* ... ;-) ... that it is a minor issue -> changed for R-patched and R-devel. Martin Maechler, ETH Zurich > Also, to make 'differences' consistently integer, > diffinv.vector(diffinv.vector(x, lag, > differences-1, diff(xi, lag=lag, differences=1)), lag, 1, > xi[1L:lag]) > in the end part can be changed to > diffinv.vector(diffinv.vector(x, lag, > differences-1L, diff(xi, lag=lag, differences=1L)), lag, > 1L, xi[1L:lag])
Seemingly Similar Threads
- factor(x, exclude=y) if x is a factor
- Suggestions for 'diff.default'
- Was confused with options(error = expression(NULL)) in example(stop)
- Undocumented 'use.names' argument to c()
- ans[nas] <- NA in 'ifelse' (was: ifelse() woes ... can we agree on a ifelse2() ?)