0

I am struggling to get some nice formatted tables from RStudio in Excel. Looking for a workaround I started this topic: export excel friendly tables via HTML/CSS

Hopefully it does not look too rude, but I want to split my problem in two questions. Question here then is. Can I install a working version of openxlsx without RTools? That should be version 4.1.0. The R version is 3.3.3.

R keeps installing 4.0.17. Forcing source install is giving an error, with warnings.

  • "Warning: running command 'make -f "C:/..............had status 127"

  • "ERROR: compilation failed for package 'openxlsx'"

  • "running command '"C:/....had status 1"

  • "installation of package ‘C:/...had non-zero exit status"

Update:

-------------------------------------------------------------------------
> 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
Peter P.
  • 51
  • 7
  • Please post full error message as well as the output of `sessionInfo()` – Tung Jul 22 '18 at 15:31
  • Where did you get `RStudio 4.3.3`? The latest version is [`1.1.456`](https://www.rstudio.com/products/rstudio/download/). [`R 3.5.1`](https://www.r-bloggers.com/r-3-5-1-update-now-available/) was only released in early July – Tung Jul 22 '18 at 15:34
  • Thanks Tung I added the info – Peter P. Jul 23 '18 at 09:55
  • follow this [answer](https://stackoverflow.com/questions/50034966/no-rtools-compatible-with-r-version-3-5-0-was-found/50278862#50278862) to properly install `RTools` – Tung Jul 23 '18 at 15:42
  • your R version is too old. You should update upgrading to the latest version. There are big changes that help increase speed and lower memory usage since `R 3.5.0` http://blog.revolutionanalytics.com/2018/04/r-350.html – Tung Jul 23 '18 at 15:43
  • ok, Tung you are saying there still is a RTools dependency? Eventually will a R upgrade be an option. Installing RTools on my work computer is not really an option. – Peter P. Jul 23 '18 at 16:35
  • Yes. You must have RTools to build R packages from sources. You can update and run portable RTools & R & RStudio https://stackoverflow.com/questions/34368287/rtools-with-r-portable & https://gist.github.com/ofurkusi/09a432ed1fb15c72eec9 – Tung Jul 23 '18 at 16:46

1 Answers1

0

You can't install it from source without Rtools, but the current binary version on CRAN is 4.1.0, not 4.0.17. Maybe your R version is too old? (The RStudio version is irrelevant. Current openxlsx requires R 3.3.0 or newer.)

user2554330
  • 37,248
  • 4
  • 43
  • 90
  • As far as I can see should the R-version not be the problem. >R.Version() $version.string [1] "R version 3.3.3 (2017... – Peter P. Jul 22 '18 at 11:42
  • Perhaps your CRAN mirror isn't up to date. I recommend https://cloud.r-project.org for almost everyone: RStudio keeps it up to date, and it's generally as fast as any of them. – user2554330 Jul 22 '18 at 14:31
  • Selecting an other mirror is gving the same result. – Peter P. Jul 23 '18 at 09:57