I would like to add small svg or preferably png images (displaying chemical structures) into a generic x-y plotting generated with the"Table R-view" node .
Doing the plot itself is no issue, but I'm unable to add my images into this plot. The resulting plot should look similar as the one you see in this discussion forum.
In this link they explain how to place png files into a R-plot. Any idea how I could this within KNIME?
On one side the KNIME column with the png file does not occur in the list of selectable columns in the "Table R-view" node. So how to import ? Would rasterImage then work for multiple rows?
On the other side how can I do this with svg files? Here the advantage is that the "svg" column is selectable in the "Table R-view" node, but I'm unable to place the images into the plot. I tried add.image and image.plot, but I get the error: Execution of R script failed: Function cannot be found.
You could use the "create temp dir" node and "image column writer" node to save the images to a temporary directory, and then access them via their paths in the R View
Thanks for your help. I still struggle though I tried various possibilitites. Somehow the best I got was using the rasterImage() function, but I still could not manage to read back the png files.
I attach a very simple workflow with some made up data . If any one could get me the correct coding I would very much appreciate .
Have a look at the attached workflow and let me know if this gets you there. The solution uses ggplot2 and loop to append the structures from a temporary folder.
Using your workflow I noticed that there are also R Interactive nodes available which provide even more functionality:-)
Interestingly these nodes also support the PNG image as a column. In your workflow you have filtered this column out out just sending to the R node). Given this possibility I wonder if it is necessary to use the work-around to export and re-import the png files? I did not get it working, but it might be easy for you or someelse.... If possible I would be curious for the code.
@ other users: I had to install the png library into my R installation to get the last R view node working properly. To do so search for the RGui.exe within the KNIME installation and follow the menu installation.