if (FALSE) {
f <- function(x) {
util_expect_scalar(x, check_type = is.integer)
}
f(42L)
try(f(42))
g <- function(x) {
util_expect_scalar(x, check_type = is.integer, convert_if_possible =
as.integer)
}
g(42L)
g(42)
}
Run the code above in your browser using DataLab