R开发工具无法正确安装

问题描述 投票:0回答:1

我正在尝试开始使用http://r-pkgs.had.co.nz/intro.html上的软件包开发书来打包我为个人使用而开发的一些脚本。我一直遇到安装开发工具的问题,这已经证明非常令人沮丧。

这适用于R ver 3.4.4,它已经设置为与knitr和rmarkdown一起用于生成报告。它位于公司网络和计算机上,这使得网络很大程度上无法控制。我安装了RTools(v.3.5.0.4),它与RBuildTools位于同一目录中。

当运行'has_devel()'时,我遇到一个循环,其中Rstudio尝试安装RBuildTools,完成时没有错误或通知,但是当重新检查'has_devel()'时,它会尝试再次安装它。

我已经浏览了https://github.com/r-lib/devtools/issues/234的列表,但没有一个解决方案有效。

Session info

R version 3.4.4 (2018-03-15)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252 
[2] LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets 
[6] methods   base     

loaded via a namespace (and not attached):
[1] compiler_3.4.4 tools_3.4.4    yaml_2.2.0    
[4] xfun_0.5      
> library(devtools)
> has_devel()
Error: Could not find tools necessary to compile a package
> has_devel()
trying URL 'https://cran.revolutionanalytics.com/bin/windows/Rtools/Rtools35.exe'
Content type 'application/octet-stream' length 108622512 bytes (103.6 MB)
downloaded 103.6 MB

Error: Could not find tools necessary to compile a package
> has_devel()
Error: Could not find tools necessary to compile a package

跟进'找不到工具'的通知,我试图加载所有的devtools

devtools::load_all()
Error: No root directory found in \\USERSTORE/02/5028/Documents or its parent directories. Root criterion: contains a file `DESCRIPTION`
In addition: Warning messages:
1: In normalizePath(path.expand(path), winslash, mustWork) :
  path[1]="\\USERSTORE": The specified path is invalid
2: In normalizePath(path.expand(path), winslash, mustWork) :
  path[1]="\\USERSTORE": The specified path is invalid

我只是尝试设置这个环境,以便我可以开始一个简单的打包过程。

r devtools rtools
1个回答
0
投票

我遇到了类似的问题,这是因为我的库安装路径是在网络驱动器上定义的。看起来您的库的目录不存在,或者您没有查看它们的权限。

在运行install命令之前,可以尝试通过.libPaths()函数更改此设置。

© www.soinside.com 2019 - 2024. All rights reserved.