Skip to content
Related Articles

Related Articles

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:

filter_none

edit
close

play_arrow

link
brightness_4
code

# R program to convert an integer to UTF8
  
# Calling the intToUtf8() function
intToUtf8(4)
intToUtf8(10)
intToUtf8(58)

chevron_right


Output:

[1] "\004"
[1] "\n"
[1] ":"

Example 2:

filter_none

edit
close

play_arrow

link
brightness_4
code

# R program to convert an integer to UTF8
  
# Creating a vector
x <- c(49, 100, 111)
  
# Calling the intToUtf8() function
intToUtf8(x)
intToUtf8(x, multiple = TRUE)

chevron_right


Output:

[1] "1do"
[1] "1" "d" "o"
My Personal Notes arrow_drop_up
Recommended Articles
Page :