2

I've been using the ReporteRs package to generate MS Word documents from R. Due to some Java problems, I tried the officer package as well. Ever since I installed officer, I am unable to load the ReporteRs package:

library(ReporteRs)

Loading required package: ReporteRsjars

Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : there is no package called ‘officer’

Warning: Error in : package or namespace load failed for ‘ReporteRs’

I've tried deleting all three packages (both using pacman::p_delete() and by physically deleting the folders from my library) and reinstalling.

If I install all three packages, the error message is:

Error : object ‘ph_from_xml_at’ is not exported by 'namespace:officer' Warning: Error in : package or namespace load failed for ‘ReporteRs’

I can't even find where this function is called from in ReporteRs or ReporteRsjars and I'm completely at loss as to how to go back to what worked.


Edit: I've tried both using my (usual) microsoft R version, on which ReporteRs has worked before, and regular R 3.4.

sessionInfo():

R version 3.4.0 (2017-04-21)

Platform: x86_64-w64-mingw32/x64 (64-bit)

Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale: [1] LC_COLLATE=Danish_Denmark.1252 LC_CTYPE=Danish_Denmark.1252 LC_MONETARY=Danish_Denmark.1252 LC_NUMERIC=C
[5] LC_TIME=Danish_Denmark.1252

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] compiler_3.4.0 tools_3.4.0

In the Microsoft client, the sessionInfo is

R version 3.3.3 (2017-03-06) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows >= 8 x64 (build 9200)

locale:

[1] LC_COLLATE=Danish_Denmark.1252 LC_CTYPE=Danish_Denmark.1252 LC_MONETARY=Danish_Denmark.1252 LC_NUMERIC=C
[5] LC_TIME=Danish_Denmark.1252

attached base packages:

[1] stats graphics grDevices utils datasets methods base

other attached packages:

[1] RevoUtilsMath_10.0.0 RevoUtils_10.0.3 RevoMods_11.0.0 MicrosoftML_1.3.0 mrsdeploy_1.1.0 RevoScaleR_9.1.0
[7] lattice_0.20-34 rpart_4.1-10

loaded via a namespace (and not attached):

[1] codetools_0.2-15 CompatibilityAPI_1.1.0 foreach_1.4.3 grid_3.3.3 R6_2.2.2
[6] jsonlite_1.3 curl_2.3 iterators_1.0.8 tools_3.3.3 mrupdate_1.0.1

BjaRule
  • 171
  • 5
  • 1
    output of session info wld be useful. I'm running both of these pkgs on my macOS system w/o issue. – hrbrmstr Jul 11 '17 at 21:57
  • Not sure it will solve your issue but try this: 0. make sure no R session is opened. 1. delete all libraries (officer, rvg, ReporteRs, ReporteRsjars) manually 2. open a new R session and run `install.packages(c("officer", "ReporteRs"))`. – David Gohel Jul 12 '17 at 11:14
  • Hi David. Thanks for the reply. I tried this already, also tried deleting and then installing from cran, your github or from an older Microsoft mran snapshot. Same result every time, except from GitHub it won't even install because it's from source and it fails the 'can the package be loaded test. – BjaRule Jul 13 '17 at 18:09
  • Officer is not listed as a dependency of ReporteRs on cran. Should it be loading functions from officer at all? I can't even find any mention of ph_from_xml_at in the ReporteRs source code. – BjaRule Jul 13 '17 at 18:12
  • Hi BjaRule, I have faced with a similar problem, could you find a solution? – rnorouzian Dec 28 '17 at 20:59
  • No @rnorouzian, we gave up. We had to use a non-R product to solve the issues. I would have strongly preferred an R based solution. – BjaRule Jan 01 '18 at 01:32
  • If you're just interested in exporting graphs to Word & Powerpoint you can also use my new package export that's built on top of officer: https://cran.r-project.org/web/packages/export/index.html and https://github.com/tomwenseleers/export – Tom Wenseleers Nov 04 '18 at 00:47

0 Answers0