Closed gsee closed 5 years ago
Calling last on Date vectors when n is character results in an error.
last
n
This worked in older versions of xts:
> last(as.Date(0)+1:5, "2 days") [1] "1970-01-05" "1970-01-06"
> last(as.Date(0)+1:5, "2 days") Error in `[.default`(x, (NROW(x) - n + 1):NROW(x), , drop = FALSE) : incorrect number of dimensions
R version 3.6.0 (2019-04-26) Platform: x86_64-apple-darwin15.6.0 (64-bit) Running under: macOS Mojave 10.14.5 Matrix products: default BLAS: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRblas.0.dylib LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] xts_0.12-1 zoo_1.8-6 loaded via a namespace (and not attached): [1] compiler_3.6.0 grid_3.6.0 lattice_0.20-38
Thanks for testing the development version of xts, and for this bug report! This should be fixed now. Please continue testing and let me know if you find any other issues.
Description
Calling
last
on Date vectors whenn
is character results in an error.Expected behavior
This worked in older versions of xts:
Minimal, reproducible example
Session Info