-
Notifications
You must be signed in to change notification settings - Fork 194
Open
Description
Example below uses && within a call to vapply() which prevents warnings/errors
packageVersion("lintr")
#> [1] '3.2.0.9000'
library(lintr)
example <- expression(
tibble::tibble(
id = 1:4,
x = list(a = 1:2, b = 3:4, c = NULL, d = "a")
) |>
dplyr::filter(
vapply(x, function(i) is.numeric(i) && mean(i) > 1, NA)
)
)
lint(
text = as.character(example),
linters = list(vector_logic_linter())
)
#> <text>:1:124: warning: [vector_logic_linter] Use `&` in subsetting expressions.
#> dplyr::filter(tibble::tibble(id = 1:4, x = list(a = 1:2, b = 3:4, c = NULL, d = "a")), vapply(x, function(i) is.numeric(i) && mean(i) > 1, NA))
#> ^~Created on 2025-09-25 with reprex v2.1.1
Metadata
Metadata
Assignees
Labels
No labels