I use the R package ReporteRs from https://github.com/davidgohel/ReporteRs to generate Powerpoint reports. This works also in KNIME by using theR Interactive integration within KNIME. I use the Table to R and Add Table to R nodes to collected my tables and then generate the Powerpoint slides in a R to Table node. See example code below.
My questions are:
1) How can I do similar things with images ? That means: Read an Image in KNIME, transfer it to the R world and use this image in an R script!
2) The R to Table node expects an output dataframe like knime.out. I use the assignment of such an output just as a dummy information that is not really needed (see last row of example code). Is there is more elegant way ?
Hi Frank, sorry to hijack your topic but i also am looking into using this package within Knime. When i run the code in R studio all works fine, however if i do the same from within Knime i get this error message:
Loading required package: ReporteRsjars
Error : .onLoad failed in loadNamespace() for 'ReporteRsjars', details:
call: .jinit()
error: Unable to create a Java class loader.
In addition: Warning messages:
1: package 'ReporteRs' was built under R version 3.1.3
2: package 'ReporteRsjars' was built under R version 3.1.3
3: In .jinit() : Cannot set VM parameters, because VM is running already.
Error: package 'ReporteRsjars' could not be loaded
Any idea what could be causing this and how to fix it? Did you do anything special to get this package to work? I've used R to create ggplot images from within Knime and it always worked, expect for ReporteRs that is.
To answer your question, i think if you create your images in ggplot in R you would be able to add them to the powerpoint easily by just adding them to the R script.
At least that is my plan going forward. I have already created the images in ggplot and am now looking into a way to generate a powerpoint and word document with these images.
The setup via KNIME requires the following packages for ReporteRs: rJava, ggplot2. ReporteRsjars (See: https://github.com/davidgohel/ReporteRs) Maybe this has to do with your error message. Can you check if all packages are available under R?
RE. IMAGES: My "problem" is a bit different. I already have images in the KNIME workflow that I want to hand over to a "R node".
Indeed i think not all the packages were up to date. Now i've managed to get it working. I am not completely sure how you can tackle your problem. I dont think you can hand over images to the R node, only generate them there yourself in a plot or by picking them up from a folder somewhere.
Have you already tried to write the images to a folder earlier in the workflow and pick them up later when you run ReportRs? That could be a solution i think.