Error from R snippet

Hello,
I wrote the following R code

library(geosphere)
d<-distm(cbind(kIn$“Long”,kIn$“Lat”),cbind(kIn$“Long_2”,kIn$“Lat_2”))
rOut <- d

and tried to execute the R snippet. I get the following error:

ERROR R Snippet 0:31 Execute failed: Failed to retrieve rOut from R:
attempt to access org.rosuda.REngine.REXPNull as String

Could you please help. Thanks, Shari

Hi there @hello_knime -

I would recommend using KNIME’s R Snippet node as opposed to the community version of the node.

I used the following code and was able to get a valid result:

library(geosphere)
d<-distm(cbind(knime.in$"Long",knime.in$"Lat"),cbind(knime.in$"Long_2",knime.in$"Lat_2"))
knime.out <- d
3 Likes

Thank you very much ScottF. It works!

2 Likes

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