powered by
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.
vector %in% set
==
%chin%
{data.table}
scalar_in_linter()
best_practices, consistency, efficiency, readability
scalar %in% vector is OK, because the alternative (any(vector == scalar)) is more circuitous & potentially less clear.
scalar %in% vector
any(vector == scalar)
linters for a complete list of linters available in lintr.