Cyrillic encoding output in R

丶灬走出姿态 提交于 2019-11-29 05:08:10

I know your pain about encoding troubles:( Hope this will help you:

    > Sys.setlocale(,"ru_RU")
    [1] "ru_RU/ru_RU/ru_RU/C/ru_RU/C"
    > test = c("привет","пока")
    > write(test, file="test.txt")

You can even use cyrillic variables after that Sys.setlocale(,"ru_RU"):

   > привет <- rnorm(100)
   > min(привет)
   [1] -2.54578

Так что удачи! :)

If you just visit the help page of Encoding() you find the native function enc2native(x), this'll do the trick as in

test = enc2utf8(c("привет","пока"))
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!