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

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

letterCloud(demoFreq, "R")

运行出来的结果为:
在这里插入图片描述
无法出现词云效果,网上查了相关问题,发现是在包安装的过程中出现的问题,我当时是在R语言里直接用

install.packages("wordcloud2")

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

library('devtools')
devtools::install_github("lchiffon/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")

成功绘制出图案
在这里插入图片描述

  • 3
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 7
    评论
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值