R Studio安装stringi失败

时间:2017-11-19 13:06:44

标签: r rstudio r-markdown stringi

我试图调用knit,告诉我它需要rmarkdown的更新版本,需要包stringi

安装stringi时出现以下错误:

> install.packages("stringi")

Installing package into ‘C:/Users/matan/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)

  There is a binary version available but the source version is later:
        binary source needs_compilation
stringi  1.1.5  1.1.6              TRUE

  Binaries will be installed
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/stringi_1.1.5.zip'
Warning in install.packages :
  cannot open URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/stringi_1.1.5.zip': HTTP status was '404 Not Found'
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  cannot open URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/stringi_1.1.5.zip'
Warning in install.packages :
  download of package ‘stringi’ failed

我该如何解决这个问题,以便最终能knit .RMD我的https://cran.r-project.org/web/packages/stringi/index.html?{/ p>

修改(解决方案)

  1. > install.packages(".../Downloads/stringi_1.1.6.zip", repos = NULL, type = "source")下载Windows二进制文件(r-release:stringi_1.1.6.zip)
  2. #include <iostream> using namespace std; int main() { char Name[5]; Name = "Luke"; cout<<"Character 0 :"<<Name[0]<<endl; cout<<"Character 1 :"<<Name[1]<<endl; cout<<"Character 2 :"<<Name[2]<<endl; cout<<"Character 3 :"<<Name[3]<<endl; cout<<"Character 4 :"<<Name[4]<<endl; return 0; }
  3. 安装

1 个答案:

答案 0 :(得分:10)

最简单的解决方案是从here下载 .zip .tar.gz 文件,然后在RStudio 工具中选择安装它 - &GT; 安装软件包...... ,将安装从:更改为软件包存档文件,然后选择下载的文件。