We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Subsetting using [.xts drops classes when zero-width.
[.xts
Think the culprit is the use of .xts() in if (length(j) == 0 || ... This is another inconsistency for zero-width objects like #355 although unrelated.
.xts()
if (length(j) == 0 ||
All classes to be retained consistent with other subsetting.
> object <- as.xts(AirPassengers) > class(object) <- c("custom", "xts", "zoo") > class(object) [1] "custom" "xts" "zoo" > class(object[,0]) [1] "xts" "zoo"
R version 4.1.1 (2021-08-10) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 20.04.3 LTS Matrix products: default BLAS/LAPACK: /opt/intel/oneapi/mkl/2021.4.0/lib/intel64/libmkl_rt.so.1 locale: [1] LC_CTYPE=en_GB.UTF-8 LC_NUMERIC=C LC_TIME=en_GB.UTF-8 [4] LC_COLLATE=en_GB.UTF-8 LC_MONETARY=en_GB.UTF-8 LC_MESSAGES=en_GB.UTF-8 [7] LC_PAPER=en_GB.UTF-8 LC_NAME=C LC_ADDRESS=C [10] LC_TELEPHONE=C LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] xts_0.12.1 zoo_1.8-9 loaded via a namespace (and not attached): [1] compiler_4.1.1 tools_4.1.1 grid_4.1.1 lattice_0.20-45
The text was updated successfully, but these errors were encountered:
3b2c1fa
joshuaulrich
No branches or pull requests
Description
Subsetting using
[.xts
drops classes when zero-width.Think the culprit is the use of
.xts()
inif (length(j) == 0 ||
... This is another inconsistency for zero-width objects like #355 although unrelated.Expected behavior
All classes to be retained consistent with other subsetting.
Minimal, reproducible example
Session Info
The text was updated successfully, but these errors were encountered: