R/transform.R
as_numeric.Rd
Convert variable to numeric avoiding potential issues with factors
as_numeric(x)
x | Input variable |
---|
Numeric
#> [1] -0.55369938 0.62898204 2.06502490 -1.63098940 0.51242695 -1.86301149 #> [7] -0.52201251 -0.05260191 0.54299634 -0.91407483as_numeric(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] 3 4#> [1] 3 4