Answers for "character to integer r"

R
1

r string to integer

# Usage
strtoi(x, base = 0L)

# Arguments
# x	
# a character vector, or something coercible to this by as.character.

# base	
# an integer which is between 2 and 36 inclusive, or zero (default).

# Examples
strtoi(c("0xff", "077", "123"))
strtoi(c("ffff", "FFFF"), 16L)
strtoi(c("177", "377"), 8L)
Posted by: Guest on December-03-2020
0

character to integer in r

x = "1.3"
x = as.Integer(x)
# x = 1
is.Integer(x)
# TRUE
Posted by: Guest on February-18-2021

Browse Popular Code Answers by Language