Windows系统下,大家在安装时出现错误,如下:
install.packages(“stringi”)
Installing package into ‘C:/Users/*****/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
There is a binary version available but the source version is later:
binary source needs_compilation
stringi 1.7.6 1.7.8 TRUE
installing the source package ‘stringi’
试开URL’https://cran.rstudio.com/src/contrib/stringi_1.7.8.tar.gz’
Warning in install.packages :
InternetOpenUrl失败:’操作超时’
Error in download.file(url, destfile, method, mode = “wb”, …) :
无法打开URL’https://cran.rstudio.com/src/contrib/stringi_1.7.8.tar.gz’
Warning in install.packages :
download of package ‘stringi’ failed
解决方法如下:
既然 无法打开URL’https://cran.rstudio.com/src/contrib/stringi_1.7.8.tar.gz’,那么就复制该网址直接下载stringi文件包到电脑上。
下载后,直接安装
install.packages(“…/Downloads/stringi_1.7.8.tar.gz”, repos = NULL, type = “source”) #前面为下载路径
成功安装stringi
library(stringi’)#没有问题
类似的大家以后遇到类似的其他包的安装都可以用这个方式来试一试。