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

addPlot .jcall error :DrawingML #199

Closed Jannickz closed 7 years ago

Jannickz commented 7 years ago

Hi, the addPlot function used to work totally fine but recently I encounter some error that is very weird. As indicated in the following code, the plots 'T5m','T5p','T5f','T5c' are using exactly the same function to plot just with some different parameter. I am not sure whether there's a maximum amount of the plot in one slide?

> SCD <- addSlide(SCD, "Ruptures")
> SCD <- addTitle(SCD, "Ruptures - Total Business")
> SCD <- addPlot(SCD, fun=print, x= RT)
> SCD <- addPlot(SCD, fun=print, x= T5m)
> SCD <- addPlot(SCD, fun=print, x= T5p)
> SCD <- addParagraph( SCD, value = 'Comments:')
> SCD <- addPlot(SCD, fun=print, x= T5f)
Error in .jcall(slide, "I", "add", dml.object) : 
  java.lang.Exception: class DrawingML: elements need to be set...
> SCD <- addPlot(SCD, fun=print, x= T5c)
Error in .jcall(slide, "I", "add", dml.object) : 
  java.lang.Exception: class DrawingML: elements need to be set...
> SCD <- addPlot(SCD, fun=print, x= resp)
Error in .jcall(slide, "I", "add", dml.object) : 
  java.lang.Exception: class DrawingML: elements need to be set...

In addition, I tried to set vector.graphics=F, then the error does not appear, but the image turns out to be cut off some of the axis, is there any way to show the whole image? Tried setting the width, doesn't make any difference..

My sessionInfo:

> sessionInfo()
R version 3.3.3 (2017-03-06)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    

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

other attached packages:
 [1] gdtools_0.1.4       readr_1.1.0         lazyeval_0.2.0      ReporteRs_0.8.8     ReporteRsjars_0.0.2 gridExtra_2.2.1    
 [7] stringr_1.2.0       openxlsx_4.0.17     ggExtra_0.6         scales_0.4.1        ggplot2_2.2.1       dplyr_0.5.0        
[13] tidyr_0.6.1         plyr_1.8.4          lubridate_1.6.0     rJava_0.9-8        

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.10      R.methodsS3_1.7.1 R.utils_2.5.0     base64enc_0.1-3   tools_3.3.3       digest_0.6.12    
 [7] tibble_1.3.0      gtable_0.2.0      png_0.1-7         shiny_1.0.2       DBI_0.6-1         knitr_1.15.1     
[13] xml2_1.1.1        officer_0.1.1     hms_0.3           R6_2.2.0          rvg_0.1.3         purrr_0.2.2      
[19] magrittr_1.5      htmltools_0.3.5   assertthat_0.2.0  mime_0.5          colorspace_1.3-2  xtable_1.8-2     
[25] httpuv_1.3.3      labeling_0.3      stringi_1.1.5     miniUI_0.1.1      munsell_0.4.3     R.oo_1.21.0 

The java version:

> .jcall('java.lang.System','S','getProperty','java.version')
[1] "1.8.0_111"

Thanks!

davidgohel commented 7 years ago

Hi, sorry without a reproducible code, I can't reproduce.