【发布时间】:2018-07-22 09:06:06
【问题描述】:
我正在努力从 Excel 中的 RStudio 获取一些格式良好的表格。 寻找解决方法我开始了这个话题:export excel friendly tables via HTML/CSS
希望它看起来不会太粗鲁,但我想将我的问题分成两个问题。 那么这里的问题是。 我可以在没有 RTools 的情况下安装 openxlsx 的工作版本吗? 那应该是4.1.0版。 R 版本是 3.3.3。
R 继续安装 4.0.17。 强制源安装会出现错误,并带有警告。
“警告:运行命令 'make -f "C:/........ 状态为 127"
“错误:包‘openxlsx’编译失败”
"运行命令'"C:/....状态为 1"
“安装包‘C:/...有非零退出状态”
更新:
-------------------------------------------------------------------------
> install.packages("openxlsx")
There is a binary version available but the source version is later:
binary source needs_compilation
openxlsx 4.0.17 4.1.0 TRUE
Binaries will be installed
etc…
------------------------------------------------------------------------
> install.packages("openxlsx", type = "source")
trying URL 'https://cran.rstudio.com/src/contrib/openxlsx_4.1.0.tar.gz'
Content type 'application/x-gzip' length 1474393 bytes (1.4 MB)
downloaded 1.4 MB
* installing *source* package 'openxlsx' ...
** package 'openxlsx' successfully unpacked and MD5 sums checked
** libs
*** arch - i386
Warning: running command 'make -f "C:/PROGRA~1/R/R-33~1.3/etc/i386/Makeconf" -f "C:/PROGRA~1/R/R-33~1.3/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="openxlsx.dll" OBJECTS="RcppExports.o helper_functions.o load_workbook.o openxlsx_init.o read_workbook.o write_data.o write_file.o write_file_2.o"' had status 127
ERROR: compilation failed for package 'openxlsx'
* removing 'C:/Program Files/R/R-3.3.3/library/openxlsx'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-33~1.3/bin/x64/R" CMD INSTALL -l "C:\Program Files\R\R-3.3.3\library" C:\Users\myname\AppData\Local\Temp\RtmpSSbC8h/downloaded_packages/openxlsx_4.1.0.tar.gz' had status 1
Warning in install.packages :
installation of package ‘openxlsx’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\myname\AppData\Local\Temp\RtmpSSbC8h\downloaded_packages’
------------------------------------------------------------------------
> install.packages("Rcpp")
There is a binary version available but the source version is later:
binary source needs_compilation
Rcpp 0.12.16 0.12.18 TRUE
Binaries will be installed
etc…
------------------------------------------------------------------------
> install.packages("Rcpp", type = "source")
trying URL 'https://cran.rstudio.com/src/contrib/Rcpp_0.12.18.tar.gz'
Content type 'application/x-gzip' length 3809164 bytes (3.6 MB)
downloaded 3.6 MB
* installing *source* package 'Rcpp' ...
** package 'Rcpp' successfully unpacked and MD5 sums checked
** libs
*** arch - i386
Warning: running command 'make -f "Makevars.win" -f "C:/PROGRA~1/R/R-33~1.3/etc/i386/Makeconf" -f "C:/PROGRA~1/R/R-33~1.3/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="Rcpp.dll" OBJECTS="Date.o Module.o Rcpp_init.o api.o attributes.o barrier.o"' had status 127
ERROR: compilation failed for package 'Rcpp'
* removing 'C:/Program Files/R/R-3.3.3/library/Rcpp'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-33~1.3/bin/x64/R" CMD INSTALL -l "C:\Program Files\R\R-3.3.3\library" C:\Users\myname\AppData\Local\Temp\RtmpuAWEno/downloaded_packages/Rcpp_0.12.18.tar.gz' had status 1
Warning in install.packages :
installation of package ‘Rcpp’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\myname\AppData\Local\Temp\RtmpuAWEno\downloaded_packages’
------------------------------------------------------------------------
> sessionInfo()
R version 3.3.3 (2017-03-06)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] tools_3.3.3 Rcpp_0.12.16 openxlsx_4.0.17
【问题讨论】:
-
请发布完整的错误信息以及
sessionInfo()的输出 -
谢谢 Tung 我添加了信息
-
按照answer正确安装
RTools -
您的 R 版本太旧。您应该更新升级到最新版本。自从
R 3.5.0blog.revolutionanalytics.com/2018/04/r-350.html 以来,有很大的变化有助于提高速度并降低内存使用量