Require c() to be applied before relatively expensive vectorized functions
Source:R/inner_combine_linter.R
inner_combine_linter.Rd
as.Date(c(a, b))
is logically equivalent to c(as.Date(a), as.Date(b))
;
ditto for the equivalence of several other vectorized functions like
as.POSIXct()
and math functions like sin()
. The former is to be
preferred so that the most expensive part of the operation (as.Date()
)
is applied only once.
See also
linters for a complete list of linters available in lintr.