Convert Character value to ASCII value in R Programming - charToRaw() Function Last Updated : 08 Feb, 2024 Summarize Comments Improve Suggest changes Share Like Article Like Report charToRaw() function in R Language is used to convert the given character to their corresponding ASCII value or "raw" objects. Syntax: charToRaw(x)Parameters: x: Given characters to be converted Example 1: Python3 # R program to illustrate # charToRaw function # Calling charToRaw() function over # some alphabets x <- charToRaw("a") y <- charToRaw("A") z <- charToRaw("ab") # Getting the corresponding ASCII value x y z Output : [1] 61[1] 41[1] 61 62Example 2: Python3 # R program to illustrate # charToRaw function # Initializing some strings a <- "Geeks" b <- "GFG is a CS Portal" # Calling charToRaw() function # over above strings c <- charToRaw(a) d <- charToRaw(b) # Getting the ASCII values of the above # specified strings c d Output: [1] 47 65 65 6b 73[1] 47 46 47 20 69 73 20 61 20 43 53 20 50 6f 72 74 61 6c Comment More infoAdvertise with us Next Article Convert Radian value to Degree value in R Programming - rad2deg() Function K Kanchan_Ray Follow Improve Article Tags : R Language ASCII R String-Functions Similar Reads Convert a Numeric Object to Character in R Programming - as.character() Function as.character() function in R Language is used to convert a numeric object to character object. Syntax: as.character(x) Parameters: x: Numeric Object Example 1: Python3 1== # R program to convert a numeric object # to character object # Calling as.character() function as.character(1) as.character(2 + 1 min read Substitute characters of a String in R Programming - chartr() Function chartr() function in R Programming Language is used to do string substitutions. It replaces all the matches of the existing characters of a string with the new characters specified as arguments. Syntax: chartr(old, new, x) Parameters:Â old: old string to be substitutednew: new stringx: target string 1 min read Convert an Integer to a Binary value in R Programming - as.binary() Function as.binary() function in R Language is used to convert an integer value to a binary value. Syntax: as.binary(x) Parameters: x: Integer value Example 1: Python3 1== # R Program to convert # an integer to binary # Loading library library(binaryLogic) # Calling as.binary() function as.binary(1) as.binar 1 min read Convert Degree value to Radian value in R Programming - deg2rad() Function deg2rad() function in R Language is used to convert the specified degree value to radian value. Note: This function requires 'grid' package to be installed. Syntax: deg2rad(x) Parameter: x: degree value to be converted Example 1: Python3 1== # R code to convert degree value # to radian value # Loadi 1 min read Convert Radian value to Degree value in R Programming - rad2deg() Function rad2deg() function in R Language is used to convert the specified radian value to degree value. Note: This function requires 'grid' package to be installed. Syntax: rad2deg(x) Parameter: x: radian value to be converted Example 1: Python3 1== # R code to convert radian value # to degree value # Loadi 1 min read Convert a Character Object to Integer in R Programming - as.integer() Function 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: Python3 1== # R program to convert a character object # to an integer object # Calling as.integer() function as.integer("4") as.inte 1 min read Like