更新:
我写了一篇关于在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) 我遇到了一个简单的Rcpp设置问题,我无法让它工作.我试着按照这个例子http://www.r-bloggers.com/user2013-the-rcpp-tutorial/ 但是在执行这段代码时:
library(Rcpp)
evalCpp("1 + 1", showOutput= TRUE)
Run Code Online (Sandbox Code Playgroud)
我得到了这个输出
C:/R/R-30~1.1/bin/x64/R CMD SHLIB -o "sourceCpp_33280.dll" "file8d01b0a675b.cpp"
Error in sourceCpp(code = code, env = env, rebuild = rebuild, showOutput = showOutput, :
Error 1 occurred building shared library.
WARNING: Rtools is required to build R packages but is not currently installed.
Please download and install the appropriate version of Rtools before proceeding:
Run Code Online (Sandbox Code Playgroud)
为了使它工作,我做了以下事情:
大多数类似的问题似乎表明文件路径中有一个空格,因此我几乎可以移动所有内容.但仍无法找到Rtools.我在我的笔记本电脑和桌面上试了一下它们都没有用,所以可能有一些结构我做错了.
我正在尝试安装一个R包,其中包含一些Windows下的C代码.我安装了R 3.3.0,并在计算机的D:盘上安装了Rtools 3.3.0.
而d:\Rtools\bin和d:\Rtools\mingw_64\bin都在PATH.我在命令窗口下检查了gcc命令,它正在工作.
但是当我安装软件包时,它总是试图使用c:/Rtools/mingw_64/bin/gcc,应该在d:磁盘中,然后它会c:/Rtools/mingw_64/bin/gcc: not found出错.
有人可以帮忙解决这个问题吗?
谢谢!
R 包ConvCalendar不再位于 Cran 存储库中(请参阅此处)。但是,因为我在以前的项目中大量使用了这个包,所以将它安装在我的机器上会很好,即使是旧版本也足够了。
(Windows 10 环境)
在上面的链接中,可以ConvCalendar从存档中下载旧版本。我因此做到了,并尝试通过运行(devtools也已安装和加载)来安装它:
install.packages("ConvCalendar_1.2.tar.gz", repos=NULL, type="source")
Run Code Online (Sandbox Code Playgroud)
但是,我收到以下错误消息:
> install.packages("ConvCalendar_1.0.tar.gz", repos=NULL, type="source")
Installing package into ‘C:/Users/myname/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
* installing *source* package 'ConvCalendar' ...
** libs
*** arch - i386
Warning in system(cmd) : 'make' not found
ERROR: compilation failed for package 'ConvCalendar'
* removing 'C:/Users/myname/Documents/R/win-library/3.5/ConvCalendar'
In R CMD INSTALL
Warning in install.packages :
installation of package ‘ConvCalendar_1.2.tar.gz’ had non-zero exit status
Run Code Online (Sandbox Code Playgroud)
正在寻找解决此问题的方法。
我已经查询了与我的具体问题相关的SO上的现有条目,但仍然无法解决它.
我正在尝试使用我的机器在工作,我有限制管理员权限,但我可以运行Rtools.exe,所以我安装它.
我对R的设置是:
platform x86_64-w64-mingw32
arch x86_64
os mingw32
system x86_64, mingw32
version.string R version 3.3.0 (2016-05-03)
Run Code Online (Sandbox Code Playgroud)
我是RStudion版本0.99.902.我安装了Rtools版本3.3.0.1959.
所有R,Rstudio和Rtools都安装在C:/ WORK /中,这是我有一些有限的管理员权限.
在我的系统ENV变量中,我已经设置:
C:\\WORK\\Rtools\\bin; C:\\WORK\\Rtools\\gcc- 4.6.3\\bin; C:\\WORK\\R-3.3.0\\bin\\x64;"
Run Code Online (Sandbox Code Playgroud)
我跑的时候
system('where make')
Run Code Online (Sandbox Code Playgroud)
我明白了
C:\WORK\Rtools\bin\make.exe
Run Code Online (Sandbox Code Playgroud)
我跑的时候
system('g++ -v')
Run Code Online (Sandbox Code Playgroud)
我明白了:
Using built-in specs.
COLLECT_GCC=C:\WORK\Rtools\GCC-46~1.3\bin\G__~1.EXE
COLLECT_LTO_WRAPPER=c:/WORK/rtools/gcc-46~1.3/bin/../libexec/gcc/i686-w64- mingw32/4.6.3/lto-wrapper.exe
Target: i686-w64-mingw32
Configured with: /data/gannet/ripley/Sources/mingw-test3/src/gcc/configure --host=i686-w64-mingw32 --build=x86_64-linux-gnu --target=i686-w64-mingw32 --with-sysroot=/data/gannet/ripley/Sources/mingw-test3/mingw32mingw32/mingw32 --prefix=/data/gannet/ripley/Sources/mingw-test3/mingw32mingw32/mingw32 --with-gmp=/data/gannet/ripley/Sources/mingw-test3/mingw32mingw32/prereq_install --with-mpfr=/data/gannet/ripley/Sources/mingw-test3/mingw32mingw32/prereq_install --with-mpc=/data/gannet/ripley/Sources/mingw-test3/mingw32mingw32/prereq_install --disable-shared --enable-static --enable-targets=all --enable-languages=c,c++,fortran --enable-libgomp --enable-sjlj-exceptions --enable-fully-dynamic-string --disable-nls --disable-werror --enable-checking=release --disable-win32-registry --disable-rpath --disable-werror CFLAGS='-O2 -mtune=core2 -fomit-frame-pointer' LDFLAGS=
Thread model: win32
gcc version 4.6.3 20111208 (prerelease) (GCC) …Run Code Online (Sandbox Code Playgroud) 我正在尝试建立像这里的制图
从链接安装不起作用:
`install.packages('Rcartogram', repos = 'http://www.omegahat.org/R', type = 'source')`
Installing package into ‘C:/Users/Milena/Documents/R/win-library/3.2’
(as `lib` is unspecified)
Warning in install.packages :
package ‘Rcartogram’ is not available (for R version 3.2.0)
Run Code Online (Sandbox Code Playgroud)
从zip文件中都没有:
install.packages("C:/Users/Milena/Downloads/Rcartogram_0.2-2.tar.gz", repos = NULL, type = "source")将软件包安装到'C:/Users/Milena/Documents/R/win-library/3.2'(
lib未指定)*安装源包Rcartogram...**********************************************
WARNING: this package has a configure script It probably needs manual configuration ************************************************libs
***arch - i386警告:运行命令'make -f"Makevars"-f"C:/PROGRA~1/R/R-3.2.0/etc/i386/Makeconf"-f"C:/ PROGRA~1 /R/R-3.2.0/share/make/winshlib.mk"SHLIB ="Rcartogram.dll"OBJECTS ="Rcart.o cart.o"'状态为127 ERROR:包'Rcartogram'*删除'的编译失败C:/Users/Milena/Documents/R/win-library/3.2/Rcartogram'instault.packages中的警告:运行命令'"C:/PROGRA~1/R/R-3.2.0/bin/x64/R" CMD INSTALL -l"C:\ Users\Milena\Documents\R\win-library\3.2""C:/Users/Milena/Downloads/Rcartogram_0.2-2.tar.gz"'安装时状态为1警告.包:安装包'C:/Users/Milena/Downloads/Rcartogram_0.2-2.tar.gz'具有非零退出状态
我怎么解决这个问题?
我正在使用Windows机器. …
定期——我想每当我更新 R——我在我的 64 位 Windows 机器上从源代码安装包时遇到问题。
今天我正在尝试使用devtools::install_github(). 安装在我的笔记本电脑上进行得很好,但我的台式机上没有,它可以在 下安装包*** arch - i386,但是在 下*** arch - x64,它报告错误消息
C:/PROGRA~1/R/R-34~1.4/bin/x64/R.dll:文件无法识别:文件格式无法识别
导致错误的命令是
C:/Rtools/mingw_32/bin/g++ -shared -s -static-libgcc -o PACKAGENAME.dll [...]
我相信错误是因为 R 正在使用 mingw_32 来尝试编译 64 位包。问题是,我在哪里可以告诉 R 使用 mingw_64?我已经检查了所有我能记得的地方:
R-3.4.4/etc/x64/Makeconf 状态
BINPREF ?= c:/Rtools/mingw_64/bin/PATH(在 R 中使用 验证)在Sys.getenv('PATH')mingw_32 之前包含 mingw_64。 R 必须寻找其他地方来决定使用哪个编译器......但在哪里?