R snippet graphical output/console input

Hello,

I have implemented my R script in KNIME using the R snippet node. I have some issues :

1. I cant seem to get the grapical output from the KNIME snippet when i run it. It does produce the console standard output in a new window, but the plot doesnt pop up.

something like :

p <- (ggplot(datasubmelt) +

geom_line(aes(x=time,y=value,color=variable))+

scale_color_manual(values=c("#009E73","#FF3300","#0072B2"))+......

print(p)

 

This produces no plot in the node output. Although, I was able to get the plot from the R View(Table) node, It seems a little inefficient since I have to export all my plot variables from the R Snippet to the R View node.

 

 

2. Is there a way to get user input into the R snippet. My R script has something like :

x <- as.integer(readline(prompt= "some text"))

But the R snippet fails to execute this.It basically hangs. Is there a way to get this working or another way to get user input into my R script (beside flow variables using quickforms)

Any help would be welcome. Thanks

Hi,

Is it possible to use the R view node directly to make the plot?

To input user information you can use the quickform nodes to create a flow variable that can be referenced directly from the R snippet node. By embedding the quickform in a wrapped metanode the user can make changes to the flow variable at workflow execution time. Note that the R snippet should be placed outside of the wrapped metanode for this method to function correctly. Wrapped metanodes can also be used together with the KNIME WebPortal.

Best,

Jon