Logo Search packages:      
Sourcecode: rjava version File versions  Download package

REXP org::rosuda::JRI::Rengine::createRJavaRef ( Object  o  )  [inline]

creates a jobjRef reference in R via rJava.
Important: rJava must be loaded and intialized in R (e.g. via eval("{library(rJava);.jinit()}",false), otherwise this will fail. Requires rJava 0.4-13 or higher!

Parameters:
o object to push
Returns:
Pure REXP reference of the newly created jobjRef object or null upon failure. It will have the type XT_NONE such that it can be used in assign(String, REXP)}.
Since:
JRI 0.3-7

Definition at line 738 of file Rengine.java.

References rniEval(), rniInstallSymbol(), rniJavaToXref(), rniLCons(), and rniPutString().

                                         {
      if (o == null) return null;
      String klass = o.getClass().getName();
      long l = rniEval(
                   rniLCons(
                          rniInstallSymbol(".jmkref"),
                          rniLCons(
                                 rniJavaToXref(o),
                                 rniLCons(
                                        rniPutString(klass), 0
                                        )
                                 )
                          )
                   , 0);
      if (l == 0) return null;
      return new REXP(this, l, false);    
    }


Generated by  Doxygen 1.6.0   Back to index