更新:
我写了一篇关于在Windows上安装Rtools的简短演练指南.
原版的:
我试图在Windows 7上使用RStudio构建一个R包.当我尝试通过RStudio的Build面板构建包时,我收到:
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
http://cran.rstudio.com/bin/windows/Rtools/
Run Code Online (Sandbox Code Playgroud)
加载library(devtools)和运行find_rtools(T)给出:
Scanning path...
ls : F:\Rtools\bin\ls.exe
Scanning registry...
Found F:/Rtools for 3.1
VERSION.txt
Rtools version 3.1.0.1936
[1] TRUE
Run Code Online (Sandbox Code Playgroud)
Path变量设置为:
F:\Rtools\bin;F:\Rtools\gcc-4.6.3\bin;F:\Rtools\perl\bin;F:\Rtools\MinGW\bin;F:\Program Files\R\R-3.0.2\bin\x64;F:\Program Files (x86)\HTML Help Workshop;F:\Program Files\MiKTeX 2.9\miktex\bin\x64\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Live\Shared;C:\Program …Run Code Online (Sandbox Code Playgroud) 我正在使用最新的R,RStudio和Rtools.
- 我更新了环境变量.现在我可以从命令行调用gcc或R.
当我试图从RStudio发布应用程序时,我收到以下错误,
准备部署应用程序... DONE上传应用程序包:64015 ...错误:*应用程序依赖于包"Rtools"但未安装.请在继续之前解决.执行停止
- 我试过这个,在控制台上,
> find_rtools(T)
Scanning path...
ls : D:\Rtools\bin\ls.exe
gcc: D:\Rtools\GCC-46~1.3\bin\gcc.exe
VERSION.txt
Rtools version 3.3.0.1959
Version: 3.3
[1] TRUE
Run Code Online (Sandbox Code Playgroud)
所以,Rtools似乎基本上就在那里!
- 我检查了环境变量,那些都没关系,因为我也提到过R和gcc可以从命令行启动
然而,我尝试使用installr软件包在RStudio内安装和检查,它说,
> install.Rtools()
No need to install Rtools - You've got the relevant version of Rtools installed
>
Run Code Online (Sandbox Code Playgroud)
- 这不是一个可能的重复,Rtools没有被R检测到 我尝试了所有这些.不工作.
请提出解决方案.非常感谢您的宝贵时间.
我安装了R,RStudio和devtools(下面省略了一些输出)并进行了更新。我还安装了Rtools的最新版本:
# Check R version
R.Version()
$platform
[1] "x86_64-w64-mingw32"
# OUTPUT OMITTED
$version.string
[1] "R version 3.4.3 (2017-11-30)"
# Check devtools for Rtools installation
devtools::find_rtools()
[1] TRUE
Run Code Online (Sandbox Code Playgroud)
但是,当我按Ctrl + Shift + B在RStudio中构建软件包时,会通知我找不到Rtools:
==> devtools::build()
"C:/PROGRA~1/R/R-34~1.3/bin/x64/R" --no-site-file --no-environ --no-save \
--no-restore --quiet CMD build \
"C:\Users\name\mypkg" --no-resave-data \
--no-manual
* checking for file
'C:\Users\name/mypkg/DESCRIPTION' ... OK
* preparing 'mypkg':
* checking DESCRIPTION meta-information ... OK
* checking for LF line-endings in source and make files and shell scripts
* checking for …Run Code Online (Sandbox Code Playgroud) 为了构建我的包,我需要在我工作的 Windows 计算机上安装 RTools,但我没有管理员权限。
由于安装程序是一个 .exe 文件,我什至无法打开它(被 Bromium vSentry 阻止)。因此,我无法选择具有写入权限的安装文件夹,因为我什至无法启动安装程序。
我用 Google 搜索了它,但找不到 RTools 的便携式版本或我可以解压缩的 zip。有谁知道它是否存在,如果不存在,构建我的包的方法是什么?
编辑:
作为对 Hong Ooi 答案的补充,我确实必须手动更新我的 PATH 变量,以便 RStudio 找到 RTools。要设置的 PATH 没有在任何官方文档中记录,因此我从此处复制并改编了 PATH 。我的版本是:
C:\Unsupported\Rtools\bin;C:\Unsupported\Rtools\gcc-4.6.3\bin;C:\Unsupported\Rtools\perl\bin;C:\Unsupported\Rtools\MinGW\bin;C:\Unsupported\R\R-3.3.2\bin\x64;C:\Unsupported\R\R-3.3.2\bin
Run Code Online (Sandbox Code Playgroud)