Skip to content

is_numeric_linter also applies in cases like is.numeric(x) || is.integer(x) || is.factor(x) #1636

@MichaelChirico

Description

@MichaelChirico

Follow-up to #1635 -- currently the logic can't handle the operator precedence mixing here, but this usage could be replaced by is.numeric(x) || is.factor(x).

Here is a test that was commented out:

# hopefully, by passing this test we get cases like
#   is.numeric(x) || is.logical(x) || is.integer(x) free as well.
#   probably just need to crib some logic from vector_logic_linter().
expect_lint(
  "is.logical(x) || is.integer(x) || is.numeric(x)",
  lint_msg,
  is_numeric_linter
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    false-negativecode that should lint, but doesn't

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions