You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is more of a question than a feature request. The majority of answers to the SO question "Fastest way to replace NAs in a large data.table" use approaches that replace both NA and NaN, since is.na(NaN) is true. However, nafill and setnafill at the moment do not replace NaN values. Should these new functions be expected to fill NaN values as well?
library(data.table)
x <- c(NA, NaN, 0, 1, 2)
y <- x
# using is.na to replace
y[is.na(y)] <- 0
print(y)
# [1] 0 0 0 1 2
# using nafill to replace
nafill(x, fill = 0)
# [1] 0 NaN 0 1 2
#Output of sessionInfo()
R version 3.6.0 (2019-04-26)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Mojave 10.14.6
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.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] data.table_1.12.6
loaded via a namespace (and not attached):
[1] compiler_3.6.0 tools_3.6.0 knitr_1.25 xfun_0.10
The text was updated successfully, but these errors were encountered:
This is more of a question than a feature request. The majority of answers to the SO question "Fastest way to replace NAs in a large data.table" use approaches that replace both
NA
andNaN
, sinceis.na(NaN)
is true. However,nafill
andsetnafill
at the moment do not replaceNaN
values. Should these new functions be expected to fillNaN
values as well?#
Minimal reproducible example
#
Output of sessionInfo()
The text was updated successfully, but these errors were encountered: