Re: [R] How to run own R functions in JRI

2010-10-07 Thread lord12
So if I have the R function foo and I have my main method in Java how would I call the method foo? What would be the syntax?: Do I create an REengine first? public static void main(String[] args) { } -- View this message in context: http://r.789695.n4.nabble.com/How-to-run-own-R-functions-in-J

Re: [R] How to run own R functions in JRI

2010-10-07 Thread lord12
Nevermind about the previous post. However, I in the retest sample code, I can run my own function in the command line. But, say I am creating a GUI and I want the user to enter the model parameters. How do I, within the java code, explicity call my unique function without going to the console?

Re: [R] How to run own R functions in JRI

2010-10-07 Thread jcress410
I guess the best answer to your question depends on the specifics of the implementation, but, i think if I were in your situation and I wanted to be able to call a function "foo" found in file "foo.R" every time a user clicked a button, i'd just source("path to "foo.R") which just parses the

Re: [R] How to run own R functions in JRI

2010-10-07 Thread lord12
So I copy and pasted my function to the R startup file. However, in my function, I change directories. When I run the function in Eclipse, I get a message in the console, "Cannot change working directory". Why is this? -- View this message in context: http://r.789695.n4.nabble.com/How-to-run-ow

Re: [R] How to run own R functions in JRI

2010-10-06 Thread jcress410
Sure, so, all I was saying about gedit is that it handles the R session for me, which is a neat feature but not mandatory to get the expected result, there's an rprofile.site file which describes your (user specific) preferences, you can manually edit this file to add functions at start up by d

Re: [R] How to run own R functions in JRI

2010-10-06 Thread lord12
I am still a little unsure of how I would do this. I do not want to install GEdit. Is there anyway in the retest in the included example that you can show me how I would do this? My function is: lol = function(x,y) { sum = x+y mod = sum %5 return mod } -- View this message in context:

Re: [R] How to run own R functions in JRI

2010-10-06 Thread jcress410
I think the basic answer here is "package it", which I did a couple of times but found inconvenient if I was going to change the function fairly often, i've taken a different tact, just including custom functions when R starts, i wrote a function that runs when I start the R session, loading the f