Learn R Programming

lintr (version 3.1.2)

pipe_call_linter: Pipe call linter

Description

Force explicit calls in magrittr pipes, e.g., 1:3 %>% sum() instead of 1:3 %>% sum. Note that native pipe always requires a function call, i.e. 1:3 |> sum will produce an error.

Usage

pipe_call_linter()

Arguments

Tags

readability, style

See Also

linters for a complete list of linters available in lintr.

Examples

Run this code
# will produce lints
lint(
  text = "1:3 %>% mean %>% as.character",
  linters = pipe_call_linter()
)

# okay
lint(
  text = "1:3 %>% mean() %>% as.character()",
  linters = pipe_call_linter()
)

Run the code above in your browser using DataLab