joshuaulrich / xts

Extensible time series class that provides uniform handling of many R time series classes by extending zoo.
http://joshuaulrich.github.io/xts/
GNU General Public License v2.0
219 stars 70 forks source link

Subsetting a zero-length xts always returns logical type #376

Closed joshuaulrich closed 1 year ago

joshuaulrich commented 1 year ago
x <- .xts(matrix(1L)[0,], integer(0))

storage.mode(x)
# [1] "integer"

storage.mode(x["2022",])  # should be "integer"
# [1] "logical"