安装Rtools并检查我是否可以使用它

时间:2018-01-07 14:02:59

标签: r installation package

亲爱的R用户拥有令人敬畏的大脑。

我今天新安装了R,Rstudio。

在我从cran下载Rtools.exe文件并解压后,当我尝试在Rstudio中安装软件包时,我收到了此警告消息

install.packages("Rtools")
  

将软件包安装到'C:/Users/Ellie/Documents/R/win-library/3.4'   (因为'lib'未指定)   install.packages中的警告:     包'Rtools'不可用(对于R版本3.4.3)

我无法理解" Rtools不适用于R版本3.4.3"因为它在几天前在另一台计算机上运行。

如果你对这个问题发表评论会很有帮助。

谢谢!

埃利。

我找到了帮助我检查是否可以在R中使用Rtools的网站 (感谢您告诉我Rtools不是一个包裹)

https://github.com/stan-dev/rstan/wiki/Install-Rtools-for-Windows

结果是:

Sys.getenv('PATH')
  

[1]" C:\ Rtools \ bin; C:\ Program Files \ R \ R-3.4.3 \ bin \ x64; C:\ Program Files \ R \ R-3.4.3 \ library \ Rtools \ bin; C:\ Program Files \ R \ R-3.4.3 \ library \ Rtools \ mingw_32 \ bin; C:\ WINDOWS \ system32; C:\ WINDOWS; C:\ WINDOWS \ System32 \ Wbem; C: \ Windows \ System32下\ WindowsPowerShell \ V1.0 \; C:\ Rtools \ BIN; C:\用户\埃利\应用程序数据\本地\微软\ WindowsApps;"

system('g++ -v')
  

使用内置规格。   COLLECT_GCC = C:\ PROGRA〜1 \ r \ R-34〜1.3 \库\ Rtools \ mingw_32 \ BIN \ G__〜1.EXE   COLLECT_LTO_WRAPPER = C:/PROGRA~1/R/R-34~1.3/library/Rtools/mingw_32/bin /../的libexec / GCC / i686的-W64-的mingw32 / 4.9.3 / LTO-wrapper.exe   目标:i686-w64-mingw32   配置为:../../../ src / gcc-4.9.3 / configure --host = i686-w64-mingw32 --build = i686-w64-mingw32 --target = i686-w64-mingw32 - prefix = / mingw32 --with-sysroot = / home / Jeroen / mingw-gcc-4.9.3 / i686-493-posix-dwarf-rt_v3-s / mingw32 --with-gxx-include-dir = / mingw32 / i686 -w64-mingw32 / include / c ++ --enable-static --disable-shared --disable-multilib --enable-languages = c,c ++,fortran,lto --enable-libstdcxx-time = yes --enable-threads = posix --enable-libgomp --enable-libatomic --enable -lto --enable-graphite --enable-checking = release --enable-fully-dynamic-string --enable-version-specific-runtime-libs - -disable-sjlj-exceptions --with-dwarf2 --disable-isl-version-check --disable-cloog-version-check --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-bootstrap - disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-gnu-as --with-gnu-ld --with-arch = i686 --with- tune = generic --with-libiconv --with-system-zlib --with-gmp = / home / Jeroen / mingw-gcc-4.9.3 / prerequisites / i6 86-w64-mingw32-static --with-mpfr = / home / Jeroen / mingw-gcc-4.9.3 / prerequisites / i686-w64-mingw32-static --with-mpc = / home / Jeroen / mingw-gcc- 4.9.3 / prerequisites / i686-w64-mingw32-static --with-isl = / home / Jeroen / mingw-gcc-4.9.3 / prerequisites / i686-w64-mingw32-static --with-cloog = / home / Jeroen / mingw-gcc-4.9.3 / prerequisites / i686-w64-mingw32-static --enable-cloog-backend = isl --with-pkgversion =' i686-posix-dwarf,由MinGW-W64项目构建& #39; --with-bugurl = http://sourceforge.net/projects/mingw-w64 CFLAGS =' -O2 -pipe -I / home / Jeroen / mingw-gcc-4.9.3 / i686-493-posix-dwarf-rt_v3-s / mingw32 / opt / include -I / home / Jeroen / mingw-gcc-4.9.3 / prerequisites / i686-zlib-static / include -I / home / Jeroen / mingw-gcc-4.9.3 / prerequisites / i686-w64-mingw32-静态/包括' CXXFLAGS =' -O2 -pipe -I / home / Jeroen / mingw-gcc-4.9.3 / i686-493-posix-dwarf-rt_v3-s / mingw32 / opt / include -I / home / Jeroen / mingw -gcc-4.9.3 / prerequisites / i686-zlib-static / include -I / home / Jeroen / mingw-gcc-4.9.3 / prerequisites / i686-w64-mingw32-static / include' CPPFLAGS = LDFLAGS =' -pipe -L / home / Jeroen / mingw-gcc-4.9.3 / i686-493-posix-dwarf-rt_v3-s / mingw32 / opt / lib -L ​​/ home / Jeroen / mingw -gcc-4.9.3 / prerequisites / i686-zlib-static / lib -L ​​/ home / Jeroen / mingw-gcc-4.9.3 / prerequisites / i686-w64-mingw32-static / lib -Wl, - large-address知晓'   线程模型:posix   gcc版本4.9.3(i686-posix-dwarf,由MinGW-W64项目建造)

system('where make')
  

C:\ Rtools \ BIN \的make.exe

     

C:\ PROGRAMFILES \ r \ R-3.4.3 \库\ Rtools \ BIN \的make.exe

笔记本电脑上的Rtool可用吗?

因为我在上面给你的网站上看到了这个部分

  

Sys.getenv(' PATH&#39)

     

[1]" c:\\ Rtools \\ bin; c:\\ Rtools \\ gcc-4.6.3 \\ bin; ...

但我的不是。

感谢您提前回答我的问题!

埃利。

1 个答案:

答案 0 :(得分:0)

正如Roland所说,Rtools不是R包,因此您必须在这里安装:https://cran.r-project.org/bin/windows/Rtools/history.html(according至R版本)

或者您可以了解您的Rtools是否已经安装

install.packages("pkgbuild") # pkgbuild is not available (for R version 3.5.0)
install.packages("devtools") # make sure you have the latest version from CRAN
library(devtools) # load package
devtools::install_github("r-lib/pkgbuild") # install updated version of pkgbuild from GitHub
library(pkgbuild) # load package
find_rtools()

ref:https://github.com/r-lib/devtools/issues/1772

希望你能找到路!