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

Converting xts with no dims to matrix throws error #294

Closed
joshuaulrich opened this issue Apr 28, 2019 · 0 comments
Closed

Converting xts with no dims to matrix throws error #294

joshuaulrich opened this issue Apr 28, 2019 · 0 comments
Assignees
Labels
Milestone

Comments

@joshuaulrich
Copy link
Owner

Attempts to convert an xts object to a matrix throws an error when the xts object does not have a dim attribute. This error occurred while doing reverse dependency checks for #245.

x <- .xts(1:3, 1:3)
x <- drop(x)       # drop dim attribute
m <- as.matrix(x)  # error
# Error in if (ncol(x) == 1) { : argument is of length zero

sessionInfo()
# R version 3.5.3 (2019-03-11)
# Platform: x86_64-pc-linux-gnu (64-bit)
# Running under: Ubuntu 18.04.2 LTS
#
# Matrix products: default
# BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
# LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1
#
# locale:
#  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
#  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
#  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
#  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
#  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
# [11] 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] zoo_1.8-5       compiler_3.5.3  xts_0.11-2      grid_3.5.3     
# [5] lattice_0.20-38
@joshuaulrich joshuaulrich self-assigned this Apr 28, 2019
@joshuaulrich joshuaulrich added this to the 0.12-0 milestone Jul 4, 2019
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

1 participant