I have got a huge problem with the R Snippet node and KNIME 3.1. The output of my node is a SVG file, which worked perfectly fine until KNIME 3.0.1. Now the same workflow, same node, same R code outputs a SVG file with just an empty container. True story! Please help!
thank you for reporting, I am currently working on this. Could you please mention what operating system including architecture (32/64 bit) you are working on.
R code outputs a SVG file with just an empty container
Do I understand correctly, that you are creating the SVG as a string in R and outputing that string?
I just prepared a workflow for you. If you can provide me with an email address, I can send the workflow to you (I don't want to upload the workflow here).
first of all, thank you for the workflow, I was able to find/solve the problem. I am answering here, since it may be interesting to other users.
You are using ggplot to draw a plot onto the SVG device. These plots need to be printed to actually appear on the device. The reason this worked before is that our previous method of executing R code printed every individual command, just as R does, too, and I believe it should be so for the nodes aswell.
I was able to get your workflow running by calling print on the result of the ggplot() call:
print(ggplot(...))
I hope that is okay for now, solving the problem on the KNIME R Integration side will probably take a while. Maybe some day, you will even be able to create the SVG directly from R as image output.
Thank you very much for your help, I have been playing around for some hours and finally found a very simple and convenient solution:
We can use ggsave for saving our ggplot2 plots instead of using the Cairo package/functions.
This works very well and I wouldn't even call it a "workaround". Furthermore it leads me to think that it is not a ggplot2 specific issue, but a Cairo issue?!
Best,
Marc
@Jonathan:
If you are interested, I can provide you with the updated workflow via email.