Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

last.default on Dates - incorrect number of dimensions #303

Closed
gsee opened this issue Jul 1, 2019 · 1 comment
Closed

last.default on Dates - incorrect number of dimensions #303

gsee opened this issue Jul 1, 2019 · 1 comment
Assignees
Labels
Milestone

Comments

@gsee
Copy link

gsee commented Jul 1, 2019

Description

Calling last on Date vectors when n is character results in an error.

Expected behavior

This worked in older versions of xts:

> last(as.Date(0)+1:5, "2 days")
[1] "1970-01-05" "1970-01-06"

Minimal, reproducible example

> last(as.Date(0)+1:5, "2 days")
Error in `[.default`(x, (NROW(x) - n + 1):NROW(x), , drop = FALSE) : 
  incorrect number of dimensions

Session Info

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
@joshuaulrich joshuaulrich self-assigned this Jul 4, 2019
@joshuaulrich joshuaulrich modified the milestones: 0.11-2, 0.12-0 Jul 4, 2019
@joshuaulrich
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants