R Under development (unstable) (2023-12-09 r85665 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > suppressPackageStartupMessages(library(float)) > set.seed(1234) > > > x1 = c(1, NaN, Inf, -Inf, 2, NA_real_) > s1 = fl(x1) > > x2 = matrix(1:30, 10) > x2[c(1, 3, 5, 7), 3] = NA > x2[2, 1] = NA > s2 = fl(x2) > > stopifnot(all.equal(is.na(s1), is.na(x1))) > stopifnot(all.equal(is.na(s2), is.na(x2))) > > > > stopifnot(all.equal(dbl(na.omit(s1)), na.omit(x1), check.attributes=FALSE)) > stopifnot(all.equal(dbl(na.omit(s2)), na.omit(x2), check.attributes=FALSE)) > > stopifnot(all.equal(dbl(na.omit(na.omit(s1))), na.omit(na.omit(x1)), check.attributes=FALSE)) > stopifnot(all.equal(dbl(na.omit(na.omit(s2))), na.omit(na.omit(x2)), check.attributes=FALSE)) > > proc.time() user system elapsed 0.26 0.04 0.32