[R] R et Java
Martin Morgan
mtmorgan at fhcrc.org
Sat May 6 17:22:21 CEST 2006
peut-+AOo-tre
http://www.omegahat.org/RSJava/FAQ.html:
Problem:
Trying the example for calling R from Java via
SJava/scripts/RJava --example --gui-none
(in <RHOME>/library) throws an exception
Solution:
Reinstall SJava using the -c switch, i.e.
R CMD INSTALL -c SJava_0.62-6.tar.gz
Regards,
Martin
miniar mansouri <miniarmansouri at yahoo.fr> writes:
> Bonjour,
>
> Je developpe une application java et je veux integrer du code R dans mon programme . Le programme de test que j+IBk-ai fait est :
>
>
> import org.omegahat.R.Java.*;
>
> public class REvalSample {
> public static void main(String [] args) {
> String [] rargs = {"--slave", "--vanilla"};
>
> System.out.println("Sample program to call R engine from Java");
> ROmegahatInterpreter interp = new ROmegahatInterpreter(ROmegahatInterpreter.fixArgs(rargs),false);
>
> REvaluator e = new REvaluator();
>
> Object val = e.eval("demo()");
> val = e.eval("x * 2.0");
>
> if (val != null) {
> double[] objects = (double[])val;
> for (int i=0; i<objects.length; i+-+-) {
> System.err.println("("+-i+-") " +- objects[i]);}
>
>
> }
> }
> }
>
>
> Lorsque je compile ce programme j+IBk-obtient les messages d+IBk-erreurs suivants :
>
>
> Loading RInterpreter library
> java.lang.UnsatisfiedLinkError: no RInterpreter in java.library.path
> at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1491)
> at java.lang.Runtime.loadLibrary0(Runtime.java:788)
> at java.lang.System.loadLibrary(System.java:834)
> at org.omegahat.R.Java.ROmegahatInterpreter.<clinit>(ROmegahatInterpreter.java:34)
> at rjava.REvalSample.main(REvalSample.java:11)
> Exception in thread "main".
> A mentionner , je travaille avec JBuilderX, et R.2.3.0 ,j+IBk-ai ajouter les packages SJava et rjava +AOA- R mais le probl+AOg-me est toujours pr+AOk-sent.
>
> Aider moi s+IBk-il vous plait c+IBk-est tr+AOg-s urgent .
>
>
>
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
More information about the R-help
mailing list