Skip to content

Question regarding inrange  #1884

@DavidArenburg

Description

@DavidArenburg

Consider this example

dt <- data.table(Test = c(200, 205), Min = c(100, 120), Max = c(200, 205))
dt[,Test %inrange% c(Min, Max)]
## [1] FALSE FALSE

Why am I getting FALSE for both? If I do just

200 %inrange% c(120, 205)
## [1] TRUE

I'm getting the desired output. Isn't inrange suppose to, and I quote ?inrange:

inrange checks whether each value in x is in between any of the intervals provided in lower,upper.

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