Closed haobinlaosi closed 8 years ago
sessionInfo()
sessionInfo() R version 3.3.0 (2016-05-03) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 7 x64 (build 7600)
locale: [1] LC_COLLATE=Chinese (Simplified)_People's Republic of China.936 [2] LC_CTYPE=English_United Kingdom.1252 [3] LC_MONETARY=Chinese (Simplified)_People's Republic of China.936 [4] LC_NUMERIC=C [5] LC_TIME=Chinese (Simplified)_People's Republic of China.936
attached base packages: [1] stats graphics grDevices utils datasets methods base
other attached packages: [1] wordcloud2_0.1.0
loaded via a namespace (and not attached): [1] htmlwidgets_0.6 htmltools_0.3.5 tools_3.3.0 withr_1.0.1 yaml_2.1.13 memoise_1.0.0 [7] Rcpp_0.12.5 jsonlite_0.9.21 digest_0.6.9 devtools_1.11.1
library(wordcloud2) data <- read.csv('c:/data.csv', sep="," ,header = T) data
data word freq 1 key 1 2 你 3 3 g 2 4 好 4
wordcloud2(data, size = 1,shape = 'star')
wordcloud2(demoFreqC, size = 1,shape = 'star')
demoFreqC
841 <U+91CD><U+70B9> 42 842 <U+95EE><U+9898><U+7684> 42 844 python 41 845 <U+4E3B><U+529E> 41 846 <U+4E5F><U+6709> 41 847 <U+521B><U+610F> 41 848 <U+53D1><U+751F> 41 849 <U+601D><U+8DEF> 41 850 <U+6574><U+4E2A> 41 851 <U+66F4><U+597D> 41 852 <U+6709><U+4E00><U+4E2A> 41 853 <U+6709><U+53EF> 41 854 <U+672C><U+79D1> 41 855 <U+6765><U+770B> 41 857 <U+6B7B><U+4EA1> 41 858 <U+6D41><U+884C> 41
sessionInfo()结果
sessionInfo()
locale: [1] LC_COLLATE=Chinese (Simplified)_People's Republic of China.936 [2] LC_CTYPE=English_United Kingdom.1252
[3] LC_MONETARY=Chinese (Simplified)_People's Republic of China.936 [4] LC_NUMERIC=C
[5] LC_TIME=Chinese (Simplified)_People's Republic of China.936
attached base packages: [1] stats graphics grDevices utils datasets methods base
other attached packages: [1] wordcloud2_0.1.0
loaded via a namespace (and not attached): [1] htmlwidgets_0.6 htmltools_0.3.5 tools_3.3.0 withr_1.0.1 yaml_2.1.13 memoise_1.0.0
[7] Rcpp_0.12.5 jsonlite_0.9.21 digest_0.6.9 devtools_1.11.1
使用自己的数据文件结果
library(wordcloud2) data <- read.csv('c:/data.csv', sep="," ,header = T) data
wordcloud2(data, size = 1,shape = 'star')![image](https://cloud.githubusercontent.com/assets/19802689/15879520/7d676300-2d57-11e6-89f9-0f50ee2cf759.png)
如果使用demo数据集,能够得到结果,并且没有乱码
wordcloud2(demoFreqC, size = 1,shape = 'star')
如果显示demo数据的话则会:
demoFreqC
841 <U+91CD><U+70B9> 42 842 <U+95EE><U+9898><U+7684> 42 844 python 41 845 <U+4E3B><U+529E> 41 846 <U+4E5F><U+6709> 41 847 <U+521B><U+610F> 41 848 <U+53D1><U+751F> 41 849 <U+601D><U+8DEF> 41 850 <U+6574><U+4E2A> 41 851 <U+66F4><U+597D> 41 852 <U+6709><U+4E00><U+4E2A> 41 853 <U+6709><U+53EF> 41 854 <U+672C><U+79D1> 41 855 <U+6765><U+770B> 41 857 <U+6B7B><U+4EA1> 41 858 <U+6D41><U+884C> 41
已经解决了,感谢!是环境变量的问题