R安装ggplot2包失败,提示无‘farver’包

新买的Mac,安装了Rstudio。使用时,出现成功安装加载ggplot2后,却不能使用ggplot和qplot。错误是不存在叫‘farver’这个名字的程辑包:

> qplot(mpg, wt, data = mtcars)
Error in loadNamespace(name) : 不存在叫‘farver’这个名字的程辑包

> ggplot(mtcars, aes(mpg,wt))+ geom_point()
Error in loadNamespace(name) : 不存在叫‘farver’这个名字的程辑包

解决方法:
在Rstudio画图和函数包帮助窗口中,单独安装‘farver’包。成功后,就可以使用ggplot了。
在这里插入图片描述
我也尝试了其他方法,但都失败了,在此记录:
1、代码和手动重装ggplot2, 不可行
2、接外网VPN,再次重装ggplot2, 不可行
3、写代码单独装‘farver’包,不可行,错误提示如下:

> install.packages("farver")
试开URL’https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/farver_2.0.3.tgz'
Content type 'application/x-gzip' length 1828397 bytes (1.7 MB)
========================================
downloaded 1.4 MB

Warning in install.packages :
  downloaded length 1473846 != reported length 1828397
Warning in install.packages :
  URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/farver_2.0.3.tgz': status was 'Failure when receiving data from the peer'
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  download from 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/farver_2.0.3.tgz' failed
Warning in install.packages :
  download of package ‘farver’ failed
    

显示两个Warning,“downloaded length 1473846 != reported length 1828397”和“status was Failure when receiving data from the peer”。因为我看不懂,所以无法解释。

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值