Convert a Character Object to Integer in R Programming – as.integer() Function Improve Improve Improve Like Article Like Save Article Save Share Report issue Report as.integer() function in R Language is used to convert a character object to integer object. Syntax: as.integer(x) Parameters: x: Character Object Example 1: # R program to convert a character object # to an integer object # Calling as.integer() function as.integer("4") as.integer("1.6") as.integer("-3.2") as.integer("0x400") Output: [1] 4 [1] 1 [1] -3 [1] 1024 Example 2: # R program to convert a character object # to an integer object # Creating a vector x <- c(1, 2, 3, 4, 5) # Check if the vector is an integer is.integer(x) # Convert to integer x1 <- as.integer(x) x1 # Calling is.integer() function is.integer(x1) Output: [1] FALSE [1] 1 2 3 4 5 [1] TRUE Last Updated : 16 Jun, 2020 Like Article Save Article Previous Compute the beta value of Non-Negative Numeric Vectors in R Programming - beta() Function Next Seek a Match for the Pattern in the String in R Programming - pmatch() Function Share your thoughts in the comments Add Your Comment Please Login to comment...