Rserve hangs with R Plot node

Hi forum,

I´m creating a workflow which uses the following Generic R nodes:
“Convert to R” to pass the data to the R workspace
“R Snippet” to calculate anova and Dunnet post-hoc test.
“R plot” to plot the data.

I load R and execute “library(Rserve); Rserve(args = “–vanilla”)” to start rserve.

Everything works the first time. But after executing the R plot once, if i try to execute other R nodes I get the following error
“ERROR R Plot 2:792 Unable to clone input data at port 1 (existing R workspace): org.rosuda.REngine.REXPGenericVector cannot be cast to org.rosuda.REngine.REXPString”.

So have to close R, launch it again and execute Rserve.

What I´m doing wrong? How can I prevent this behavior?

Thanks.

NTT_PMI_0.5.knwf (63.5 KB)

Hi,

I imported your workflow, but unfortunately the “raw data” is missing so I cannot execute and reproduce the problem. Could you please attach it here, or send it to me via email (stoeter[at]mpi-cbg[dot]de). Just the table that goes into the “Convert to R” would be also enough.

I am not the expert and our developer just went for vacation, but I can try to trouble shoot a bit.

Which version of R and which version of Rserve are you using?

Cheers,
Martin

1 Like

Hi,

thank you for your help!
I´m using the R version included in the “KNIME R Statistics Integration (Windows Binaries) 3.4.2.v201905311239” plugin (v 3.4.2). I’m not sure about the rserve version, but is a fresh installation through install.packages() function.

I’m going to try with an “external” up to date version of R to see if there is any differences.
Also, I´m going to locate the log file of R and rserve to get more information about this problem.

Best.

Hi Inaki,
thanks for sending the data. I can reproduce your error with the last version (KNIME 4.0), but also with an older one (3.2).
Since we rarely (never) use the “Generic” nodes I also have little experience. For sure I cannot trouble shoot the source code, we have to wait until my collegue is back (in 3 weeks).
However, as a work around could you please try to “normal” R snippet node (the one with the R as symbol)? Just combine the generic snippet node code and the convert to… node code in the snippet or in the plot. You could also check the “Open external” check box to sent the data directly to an R instance (R or R studio; Please check the preferences for the correct program link!). Then with just “paste” into a new empty script (the script is automatically in the clipboard), you should be able to trouble shoot the code in R. Once it runs there, try again to paste the code into the snippet.
I hope that helps a bit…
Best,
Martin

2 Likes

Hi Martin,

thank you very much for the suggestion! It works!!

I tried the “R Snippet” and “R plot” nodes, and now everything works perfectly! I don’t know why I even used the generic R nodes in the first place…

Also, the normal nodes are much simpler to use, since there is no need to use “Convert to R” before and “Convert to table” after.

The alternative was obvious, but i wouldn’t have tried it without you advise!

Thank you!!

1 Like

Hi Inaki,

great to hear that now you got it up and running.

With generic nodes the code and its execution can be spilt into different levels. E.g. you want to calculate a complex model that takes a lot of time, then you do this, and the output could go into a table or other calculations and a plot without recalulating the model. With the normal snippet and plot nodes you get either a table or a plot and you would need to calculate the model twice, if both is needed.

Anyway I will put the error from the generic node into your issue list and hopefully this will be solved soon…

Best,

Martin

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.