R中的非拉丁字符之间的空格

时间:2016-01-07 05:38:53

标签: r

在字符串的开头和结尾添加额外的空格,使用非拉丁字符。

西里尔字符示例:

enter image description here

拉丁字符:

enter image description here

问题在单词云中变得更加明显。例如:

library(Hmisc)
library(wordcloud)

letter <- "ж"
vec <- NULL
for(i in 3:25){
  string <- makeNstr(letter, i)
  vec <- c(rep(string, 25-i), vec)
}

wordcloud(vec, max.words=100, min.freq=1, scale=c(3, .1))

enter image description here

letter为拉丁语时的结果:

enter image description here

如果vec由非拉丁文字组成,则wordcloud密度较低。有可能解决这个问题吗?

0 个答案:

没有答案