我在安装R gtools软件包时遇到404错误:
> install.packages("gtools")
Installing package into ‘/Users/[...]/Library/R/3.1/library’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/src/contrib/gtools_3.4.2.tar.gz'
Warning in install.packages :
cannot open: HTTP status was '404 Not Found'
Error in download.file(url, destfile, method, mode = "wb", ...) :
cannot open URL 'http://cran.rstudio.com/src/contrib/gtools_3.4.2.tar.gz'
Warning in install.packages :
download of package ‘gtools’ failed
显然,最新版本不是3.4.2,而是3.5.0(见http://cran.r-project.org/web/packages/gtools/index.html),所以我想知道这是否解释了错误。如何安装gtools(3.4.2或3.5.0都可以)?我目前的设置是OS X Yosemite(10.10.3),R版本3.1.3,RStudio 0.99.437。
答案 0 :(得分:0)
版本3.5应该适用于R 2.1及更高版本。我建议您下载可用的install.packages("path_to_your_file/gtools_3.5.0.tar.gz", repos = NULL, type = "source")
文件包$ awk 'NR==FNR{a[$1]++;next} {print a[$1],$0}' inputfile inputfile
并尝试使用以下命令进行安装:
print