convert english number to persian (farsi) in r

I want to change enghish number to persian (farsi), but i dont know how to run.
I try below code but I did not consider the answer

convert_english_to_farsi<-function(x) {
  persian <- "\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669\u06F0\u06F1\u06F2\u06F3\u06F4\u06F5\u06F6\u06F7\u06F8\u06F9"
  english <- "\U0030\U0031\U0032\U0033\U0034\U0035\U0036\U0037\U0038\U0039\U0030\U0031\U0032\U0033\U0034\U0035\U0036\U0037\U0038\U0039"
  return(chartr(english,persian, x))
}

And when I executed the function to convert numbers to Persian, I got this error:

> convert_english_to_farsi(2345)
[1] "H‎!ë„\001"

A quick internet search turned up this, https://rdrr.io/cran/farsi/man/farsi-package.html

The package is not on CRAN but should be available in the archives.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.