View source: R/pipe_call_linter.R
pipe_call_linter | R Documentation |
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.
pipe_call_linter()
readability, style
linters for a complete list of linters available in lintr.
# 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()
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.