davidgohel / ReporteRs

Note that ReporteRs has been removed from CRAN the 16th of July 2018 and is not maintained anymore. please migrate to officer.
245 stars 44 forks source link

ReporteRs not producing powerpoint output #197

Closed okeyes-r7 closed 7 years ago

okeyes-r7 commented 7 years ago

So if I run something like this:

library(ReporteRs)
library(dplyr)
base_pptx_template <- "./r7app/apps/csma/templates/cc_csma_template.pptx"

pt <- ReporteRs::pptx(sprintf("%s CSMA", "foo"), base_pptx_template)
addSlide(pt, slide.layout="Control Detail") %>%
  addParagraph("TestTestTestTest") -> pt

writeDoc(pt, "test.pptx")

Only the raw template is actually produced. Is it a quirk of:

  1. Using a template
  2. ->
  3. Piping
  4. Sooomething else? It's got me kinda mystified!

Session information:

R version 3.4.0 (2017-04-21)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: OS X El Capitan 10.11.5

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages:
[1] dplyr_0.5.0         ReporteRs_0.8.8     ReporteRsjars_0.0.2

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.10      knitr_1.15.1      xml2_1.1.1        magrittr_1.5      uuid_0.1-2        munsell_0.4.3     xtable_1.8-2     
 [8] colorspace_1.3-2  R6_2.2.1          plyr_1.8.4        tools_3.4.0       grid_3.4.0        gtable_0.2.0      png_0.1-7        
[15] rvg_0.1.3         R.oo_1.21.0       DBI_0.6-1         htmltools_0.3.6   lazyeval_0.2.0    digest_0.6.12     assertthat_0.2.0 
[22] tibble_1.3.0      zip_1.0.0         shiny_1.0.3       rJava_0.9-8       officer_0.1.3     purrr_0.2.2.2     ggplot2_2.2.1    
[29] base64enc_0.1-3   R.utils_2.5.0     mime_0.5          compiler_3.4.0    gdtools_0.1.4     scales_0.4.1      R.methodsS3_1.7.1
[36] httpuv_1.3.3
davidgohel commented 7 years ago

Should be OK. Without your template, it's OK, could you send it?

David

PS: ReporteRs has been rewritten, the new package is officer, it comes without any java dependancy. If possible, you should switch to officer.

okeyes-r7 commented 7 years ago

Hmn; interesting. Does officer allow template use? (I don't see anything in the vignette but I might be missing something).

davidgohel commented 7 years ago

Yes, read_pptx has a path argument. I will add a chapter on that, thanks for the suggestion, I didn't realised.

davidgohel commented 7 years ago

If possible, send the template, I'd like to solve the issue.

okeyes-r7 commented 7 years ago

Totally! (lemme just check officer doesn't neatly sidestep it, don't wanna put you out of the way if I don't have to!)

okeyes-r7 commented 7 years ago

Okay yeah, this is gnarly, lemme just check if I can email you the template.

davidgohel commented 7 years ago

thanks, you can use that one: https://github.com/davidgohel/officer/blob/master/DESCRIPTION#L7

okeyes-r7 commented 7 years ago

Grand!

okeyes-r7 commented 7 years ago

Now fixed thanks to David! Grazie :)