在R for Windows中,我可以按如下方式分配一个unicode字符:
(u <- "\U0444")
# [1] "ф"
但是,将字符串分配给数据框会产生不可读的输出:
x <- data.frame(1)
setNames(x,u)
# <U+0444>
# 1 1
会话信息
R version 3.4.0 (2017-04-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 15063)
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C LC_TIME=English_United States.1252