因为在中国大陆安装R包,通常是切换镜像的,我会首先推荐清华的镜像给学生们,切换镜像的代码如下:
options()$repos options()$BioC_mirror options(BioC_mirror="https://mirrors.ustc.edu.cn/bioc/") options("repos" = c(CRAN="https://mirrors.tuna.tsinghua.edu.cn/CRAN/")) options()$repos options()$BioC_mirror
最近在Ubuntu里面安装R包 tidyverse:,发现报错:
During startup - Warning message: Setting LC_CTYPE failed, using "C" ERROR: dependency 'rvest' is not available for package 'tidyverse' * removing '/home/ubuntu/R/x86_64-pc-linux-gnu-library/3.6/tidyverse'
原来是有一个依赖包,名字是rvest,缺失了。安装以往的惯例,缺啥就安装啥呗;
trying URL 'https://mirrors.tuna.tsinghua.edu.cn/CRAN/src/contrib/rvest_0.3.4.tar.gz' Error in download.file(url, destfile, method, mode = "wb", ...) : cannot open URL 'https://mirrors.tuna.tsinghua.edu.cn/CRAN/src/contrib/rvest_0.3.4.tar.gz' In addition: Warning message: In download.file(url, destfile, method, mode = "wb", ...) : cannot open URL 'https://mirrors.tuna.tsinghua.edu.cn/CRAN/src/contrib/rvest_0.3.4.tar.gz': HTTP status was '404 Not Found' Warning in download.packages(pkgs, destdir = tmpd, available = available, : download of package 'rvest' failed
然后发现诡异的报错,是这个包无法被下载,这个时候我没有紧张,下意识的认为是清华镜像问题,所以我重新下载;
> install.packages('rvest') Installing package into '/home/ubuntu/R/x86_64-pc-linux-gnu-library/3.6' (as 'lib' is unspecified) trying URL 'https://cloud.r-project.org/src/contrib/rvest_0.3.5.tar.gz' Content type 'application/x-gzip' length 1129355 bytes (1.1 MB) ================================================== downloaded 1.1 MB
发现的确就没有问题了。
再次安装tidyverse也成功了。
这个下意识到底是怎么样的一个思考过程,我很难描述出来!
我在在生信分析人员如何系统入门R(2019更新版) 里面给初学者的知识点路线图如下:
本文分享自微信公众号 - 生信技能树(biotrainee),作者:生信技能树
原文出处及转载信息见文内详细说明,如有侵权,请联系 yunjia_community@tencent.com 删除。
原始发表时间:2019-11-18
本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。
我来说两句