View source: R/scalar_in_linter.R
scalar_in_linter | R Documentation |
vector %in% set
is appropriate for matching a vector to a set, but if
that set has size 1, ==
is more appropriate. %chin%
from {data.table}
is matched as well.
scalar_in_linter()
scalar %in% vector
is OK, because the alternative (any(vector == scalar)
)
is more circuitous & potentially less clear.
best_practices, consistency, efficiency, readability
linters for a complete list of linters available in lintr.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.