Re: [R] R functions in Java

2010-10-14 Thread lord12
For example, if I have the function in R: sum = function(a,b) { sum = a+b return sum } In Java: re.eval(sum(a,b)) gives me an error. -- View this message in context: http://r.789695.n4.nabble.com/R-functions-in-Java-tp2995428p2995620.html Sent from the R help mailing list archive at Nab

Re: [R] R functions in Java

2010-10-14 Thread lord12
Any advice? -- View this message in context: http://r.789695.n4.nabble.com/R-functions-in-Java-tp2995428p2995490.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r

[R] R functions in Java

2010-10-14 Thread lord12
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 c