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
This is maybe not that big of an issue by itself, but it makes min() for empty data.table fail:
min()
data.table
dt <- data.table(x = 1) dt0 <- dt[FALSE] mode(as.matrix(dt)) #> [1] "numeric" mode(as.matrix(dt0)) #> [1] "logical"
I would be expecting "numeric" for both of these.
"numeric"
data.frame behaves the same (imho wrong) way, so feel free to close with wontfix I guess.
data.frame
This causes the following problem:
min(dt) #> [1] 1 min(dt0) #> Error in FUN(X[[i]], ...) : #> only defined on a data frame with all numeric variables
Expected behaviour:
min(dt0) #> [1] Inf #> Warning message: #> In min(dt0) : no non-missing arguments to min; returning Inf
> sessionInfo() R version 4.0.2 (2020-06-22) Platform: x86_64-redhat-linux-gnu (64-bit) Running under: Fedora 32 (Thirty Two) Matrix products: default BLAS/LAPACK: /usr/lib64/libopenblas-r0.3.10.so locale: [1] LC_CTYPE=en_US.utf8 LC_NUMERIC=C [3] LC_TIME=en_US.utf8 LC_COLLATE=en_US.utf8 [5] LC_MONETARY=en_US.utf8 LC_MESSAGES=en_US.utf8 [7] LC_PAPER=en_US.utf8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.utf8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] data.table_1.13.1 loaded via a namespace (and not attached): [1] compiler_4.0.2
using
data.table 1.13.1 IN DEVELOPMENT built 2020-10-16 09:03:50 UTC
The text was updated successfully, but these errors were encountered:
min() etc. not working is now fixed in R-devel by accepting logical matrices. You could still fix the mode(as.matrix(dt0)) being logical problem, but that is more of an inconsistency that should have few real implications.
mode(as.matrix(dt0))
logical
Sorry, something went wrong.
Aside: because of that fix in R-devel our recent release is now failing on R-devel, #4769
Successfully merging a pull request may close this issue.
This is maybe not that big of an issue by itself, but it makes
min()
for emptydata.table
fail:I would be expecting
"numeric"
for both of these.data.frame
behaves the same (imho wrong) way, so feel free to close with wontfix I guess.This causes the following problem:
Expected behaviour:
using
The text was updated successfully, but these errors were encountered: