powered by
Convert variable to numeric avoiding potential issues with factors
as_numeric(x)
Input variable
Numeric
# NOT RUN { as_numeric(rnorm(10)) as_numeric(letters) as_numeric(as.factor(5:10)) as.numeric(as.factor(5:10)) as_numeric(c("a","b")) as_numeric(c("3","4")) # }
Run the code above in your browser using DataLab