0

我正在努力从 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
4

1 回答 1

0

如果没有 Rtools,您无法从源代码安装它,但 CRAN 上的当前二进制版本是 4.1.0,而不是 4.0.17。也许你的 R 版本太旧了?(RStudio 版本无关紧要。当前openxlsx需要 R 3.3.0 或更高版本。)

于 2018-07-22T11:17:58.627 回答