
complicance of n argument
=========================

> lead(letters, -1)
Error: `n` must be a nonnegative integer scalar, not a double vector of length 1.

> lead(letters, "1")
Error: `n` must be a nonnegative integer scalar, not a character vector of length 1.

> lag(letters, -1)
Error: `n` must be a nonnegative integer scalar, not a double vector of length 1.

> lag(letters, "1")
Error: `n` must be a nonnegative integer scalar, not a character vector of length 1.


ts
==

> lag(ts(1:10))
Error: `x` must be a vector, not a ts object, do you want `stats::lag()`?


incompatible default
====================

> lag(c("1", "2", "3"), default = FALSE)
Error: Can't combine `default` <logical> and `x` <character>.

