R语言wordcloud2包letterCloud函数运行失败问题

今天在学习了R语言的wordcloud2包,“顺利安装”之后,wordcloud2函数使用顺利,但是在letterCloud函数却运行不成功,如

letterCloud(demoFreq, "R")

运行出来的结果为:
R语言wordcloud2包letterCloud函数运行失败问题_第1张图片
无法出现词云效果,网上查了相关问题,发现是在包安装的过程中出现的问题,我当时是在R语言里直接用

install.packages("wordcloud2")

这个是可以直接安装,用wordcloud2函数也没问题,但就象我前面说的,lettercloud函数就不行,有遇到相同问题的网友,指出用下面的方法重新安装这个包就没有这个问题了

library('devtools')
install_github('lchffon/wordcloud2')

我运行之后

These packages have more recent versions available.
Which would you like to update?

1:   BH    (1.66.0-1 -> 1.69.0-1) [CRAN]
2:   R6    (2.2.2    -> 2.4.0   ) [CRAN]
3:   Rcpp  (1.0.0    -> 1.0.1   ) [CRAN]
4:   rlang (0.2.1    -> 0.3.1   ) [CRAN]
5:   CRAN packages only
6:   All
7:   None

Enter one or more numbers separated by spaces, or an empty line to cancel
1: 7(我选了7)
Installing 1 packages: httpuv

  There is a binary version available but the source version is later:
        binary source needs_compilation
httpuv 1.4.5.1  1.5.0              TRUE

Do you want to install from sources the package which needs compilation? (Yes/no/cancel)

注意这里要选no,我一开始选了yes后来安装失败了,选了no之后就安装成功了

no
trying URL 'https://mirrors.tuna.tsinghua.edu.cn/CRAN/bin/macosx/el-capitan/contrib/3.5/httpuv_1.4.5.1.tgz'
Content type 'application/octet-stream' length 1710657 bytes (1.6 MB)
==================================================
downloaded 1.6 MB


The downloaded binary packages are in
	/var/folders/_b/6579fvr177g_y8h__cg6z8zr0000gn/T//RtmpBdGiAv/downloaded_packages
✔  checking for file ‘/private/var/folders/_b/6579fvr177g_y8h__cg6z8zr0000gn/T/RtmpBdGiAv/remotes3dca3eb2598f/Lchiffon-wordcloud2-8a12a3b/DESCRIPTION’ (431ms)
─  preparing ‘wordcloud2’:
✔  checking DESCRIPTION meta-information ...
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
   Removed empty directory ‘wordcloud2/examples/img’
   Removed empty directory ‘wordcloud2/examples’
─  looking to see if a ‘data/datalist’ file should be added
─  building ‘wordcloud2_0.2.2.tar.gz’
   
* installing *source* package ‘wordcloud2’ ...
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (wordcloud2)

这样wordcloud2就重新安装成功了,再次运行

letterCloud(demoFreq, "R")

成功绘制出图案
R语言wordcloud2包letterCloud函数运行失败问题_第2张图片

你可能感兴趣的:(R)