[R] R functions in Java

lord12 trexinsd at yahoo.com
Thu Oct 14 16:37:28 CEST 2010


Suppose I have a function in R called foo.

foo = function(x)
{
   print(x);
}

When I create the Rengine re and do re.eval("foo(1)") I get the output 1. 
However, if I create a string variable in java String num = 1 and do
re.eval("foo(num)"), I get an error saying that num cannot be found. How can
I fix this problem.
-- 
View this message in context: http://r.789695.n4.nabble.com/R-functions-in-Java-tp2995428p2995428.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list