[R] rJava help

From: Duncan Murdoch <murdoch_at_stats.uwo.ca>
Date: Thu 04 Jan 2007 - 04:10:46 GMT

I've just bought a couple of "iButton Thermochrons" (logging thermometers), and I'd like to access them through their Java interface from R. But I've never really used Java, so I'm running into a problem, and I hope there's a very simple solution.

I've managed to use rJava to create an object with

> provider <- .jnew("com/dalsemi/onewire/OneWireAccessProvider")
> .jcall(provider,"Ljava/lang/Class;", "getClass")
[1] "Java-Object{class com.dalsemi.onewire.OneWireAccessProvider}"

and can see that it has a "getDefaultAdapter" method:

> .jmethods(provider,"getDefaultAdapter")
[1] "public static com.dalsemi.onewire.adapter.DSPortAdapter com.dalsemi.onewire.OneWireAccessProvider.getDefaultAdapter() throws com.dalsemi.onewire.adapter.OneWireIOException,com.dalsemi.onewire.OneWireException"

but when I call that, I get an error:

> adapter <- .jcall(provider,

"Lcom/dalsemi/onewire/adapter/DSPortAdapter;", "getDefaultAdapter") Error in .jcall(provider, "Lcom/dalsemi/onewire/adapter/DSPortAdapter;", :

         RcallMethod: method not found

Is it obvious what I am doing wrong?

Duncan Murdoch

R-help@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 and provide commented, minimal, self-contained, reproducible code. Received on Thu Jan 04 15:17:33 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 04 Jan 2007 - 05:30:24 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.