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.

Reply via email to