Skip to content

assertthat::assert_that strange error message with %in% operator #83

@ghost

Description

When using assertthat::assert_that with an expression involving the %in% operator, it causes a strange error message. See the below example:

assertthat::assert_that("name" %in% c("jerry", "elaine"))
# Error: `%in%`(x = "name", table = c("jerry", "elaine")) is not TRUE

Not sure if this is intended behaviour or not; any advice would be appreciated.

sessionInfo:

R version 4.2.1 (2022-06-23)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.4 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so

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

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

other attached packages:
[1] assertthat_0.2.1

loaded via a namespace (and not attached):
[1] compiler_4.2.1    tools_4.2.1       rstudioapi_0.16.0 yaml_2.3.7        renv_0.17.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions