R/transform.R
as_integer.Rd
Convert variable to integer avoiding potential issues with factors
as_integer(x)
x | Input variable |
---|
Integer
#> [1] -1 0 -2 0 0 1 -1 0 0 0as_integer(letters)#> [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 #> [26] 26#> [1] 5 6 7 8 9 10#> [1] 1 2 3 4 5 6#> [1] 1 2#> [1] 0 1#> [1] 0 1