if (FALSE) {
.jinit()
# requires JRI and REngine classes
.jengine(TRUE)
f <- function() { cat("Hello!\n"); 1 }
fref <- toJava(f)
# to use this in Java you would use something like:
# public static REXP call(REXPReference fn) throws REngineException, REXPMismatchException {
# return fn.getEngine().eval(new REXPLanguage(new RList(new REXP[] { fn })), null, false);
# }
# .jcall("Call","Lorg/rosuda/REngine/REXP;","call", fref)
}
Run the code above in your browser using DataLab