Converts numeric values to positive integers with a warning.

num2int(x)

Arguments

x
an numeric vector

Details

num2int uses as.integer functionality.

Examples

suppressWarnings(num2int(pi) == 3L)
#> [1] TRUE