Login  Register

Re: access R from ImageJ macro

Posted by ctrueden on Nov 19, 2014; 10:25pm
URL: http://imagej.273.s1.nabble.com/access-R-from-ImageJ-macro-tp5010490p5010562.html

Hi Neil,

> I downloaded Rserve_Example.java and tried to compile. Apparently it's
> missing the REngine package. Do you know how I could get this to work
> on a Mac?

If you use Maven, you can model your design after this project:

https://github.com/scijava/scripting-r

That is a project to create an R script language that would enable support
for R scripting directly within ImageJ, via RServe. It is not yet working
though, and I do not currently have time to work on it, which is why I
hesitated to reply until now. But if you are going to develop something
using RServe, that POM could serve as a useful starting point.

For further details, see:
* http://imagej.net/Maven
* https://github.com/imagej/minimal-ij1-plugin

Regards,
Curtis

On Wed, Nov 19, 2014 at 4:02 PM, Neil Fazel <[hidden email]>
wrote:

> Hi Bio7,
>
>   Thank you for this information. Since I would like to call R from within
> ImageJ, your suggestion to use Rserve from ImageJ could work. To try it, I
> downloaded Rserve_Example.java and tried to compile. Apparently it's
> missing the REngine package. Do you know how I could get this to work on a
> Mac?
>
> Thanks,
> Neil
>
>
> /Applications/ImageJ/plugins/Downloaded/Rserve_Example.java:9: package
> org.rosuda.REngine does not exist
> import org.rosuda.REngine.REXPMismatchException;
>                          ^
> /Applications/ImageJ/plugins/Downloaded/Rserve_Example.java:10: package
> org.rosuda.REngine.Rserve does not exist
> import org.rosuda.REngine.Rserve.RConnection;
>                                 ^
> /Applications/ImageJ/plugins/Downloaded/Rserve_Example.java:11: package
> org.rosuda.REngine.Rserve does not exist
> import org.rosuda.REngine.Rserve.RserveException;
>                                 ^
> /Applications/ImageJ/plugins/Downloaded/Rserve_Example.java:27: cannot
> find symbol
> symbol  : class RConnection
> location: class Rserve_Example
>                         RConnection c = new RConnection();
>                         ^
> /Applications/ImageJ/plugins/Downloaded/Rserve_Example.java:27: cannot
> find symbol
> symbol  : class RConnection
> location: class Rserve_Example
>                         RConnection c = new RConnection();
>                                             ^
> /Applications/ImageJ/plugins/Downloaded/Rserve_Example.java:34: cannot
> find symbol
> symbol  : class REXPMismatchException
> location: class Rserve_Example
>                 } catch (REXPMismatchException e) {
>                          ^
> /Applications/ImageJ/plugins/Downloaded/Rserve_Example.java:38: cannot
> find symbol
> symbol  : class RserveException
> location: class Rserve_Example
>                 } catch (RserveException e) {
>                          ^
> 7 errors
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html