Skip to content

sum with na.rm=TRUE adds another value?? #4

Description

@alexiswl

Hello,

This appears to be an issue introduced into rapportools v1.1

> library(rapportools)
Attaching package:rapportoolsThe following objects are masked frompackage:stats:

    IQR, median, sd, var

The following objects are masked frompackage:base:

    max, mean, min, range, sum

> my_list = c("c", "d", "e")

> sum(c("e" %in% my_list))
[1] 1

> sum(c("e" %in% my_list), na.rm=TRUE)
[1] 2

> sessionInfo()
R version 4.1.3 (2022-03-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.4 LTS

Matrix products: default
BLAS:   /opt/R/4/4.1.3/lib/R/lib/libRblas.so
LAPACK: /opt/R/4/4.1.3/lib/R/lib/libRlapack.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices datasets  utils     methods   base

other attached packages:
[1] rapportools_1.1 reprex_2.0.1

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.8.3        digest_0.6.29       withr_2.5.0
 [4] MASS_7.3-56         plyr_1.8.7          magrittr_2.0.2
 [7] rlang_1.0.2         stringi_1.7.6       cli_3.2.0
[10] renv_0.15.4         reshape2_1.4.4      rstudioapi_0.13
[13] fs_1.5.2            tools_4.1.3         stringr_1.4.0
[16] pander_0.6.5        glue_1.6.2          compiler_4.1.3
[19] BiocManager_1.30.16 clipr_0.8.0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions