SyntaxFix
Write A Post
Hire A Developer
Questions
Use as.integer:
as.integer
set.seed(1) x <- runif(5, 0, 100) x [1] 26.55087 37.21239 57.28534 90.82078 20.16819 as.integer(x) [1] 26 37 57 90 20
Test for class:
xx <- as.integer(x) str(xx) int [1:5] 26 37 57 90 20