Convert an Integer to UTF8 in R Programming – intToUtf8() Function
Last Updated :
16 Jun, 2020
intToUtf8()
function in R Language is used to convert an integer into UTF8 value.
Syntax: intToUtf8(x, multiple)
Parameters:
x: Integer or integer vector
multiple: Boolean value to convert into single or multiple strings
Example 1:
intToUtf8( 4 )
intToUtf8( 10 )
intToUtf8( 58 )
|
Output:
[1] "\004"
[1] "\n"
[1] ":"
Example 2:
x < - c( 49 , 100 , 111 )
intToUtf8(x)
intToUtf8(x, multiple = TRUE)
|
Output:
[1] "1do"
[1] "1" "d" "o"
Share your thoughts in the comments
Please Login to comment...