Re: [R] Using Java methods in R

2011-04-29 Thread Robert Baer
-- snip -- It clogs up my email, takes a long time to delete, and is hard to be selective enough to not delete some of my other important email. -- snip -- If you don't care about contributing to the R listserve community, it's hard to imagine why that community should care about you. Some p

Re: [R] Using Java methods in R

2011-04-29 Thread hill0093
H do I obtain a strictly rectangular type-double array (converted to an R 2-dimensional array) from a Java class? I can obtain a 1-dimensional type-double array (vector) or a scalar, but I cannot figure out the two-dimensional from the instructions. Is .jevalArray also involved? My simple Java te

Re: [R] Using Java methods in R

2011-04-27 Thread hill0093
Thanks for your two suggestions. I am too much of a beginner in R and R-forum to be able to do either of them. How do I/ Sorry. -- View this message in context: http://r.789695.n4.nabble.com/Using-Java-methods-in-R-tp3469299p3479255.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] Using Java methods in R

2011-04-27 Thread fjpcaballero
Absence of evidence is not evidence of absence. Perhaps you are not getting answers for a good reason. >From a previous email: 1) reading the source code of packages that use rJava, such as RWeka is the best way to understand how things work. If you are asked to do so is for a reason; expl

Re: [R] Using Java methods in R

2011-04-27 Thread hill0093
I don't know who to contact in the management of this R-forum, and there are a few things I cannot figure out. As I understand it, to participate and learn on the R-forum, I must receive all the emails even concerning topics I have no interest in currently. It clogs up my email, takes a long time

Re: [R] Using Java methods in R

2011-04-27 Thread hill0093
Thanks Icn for the lookup. I appreciate your skill. The static double field con0dbl started working for me too. I was surprised, and checked my code carefully. I think they corrected that in rJava. I download and install rJava each time I use R. Hill -- View this message in context: http://r.789

Re: [R] Using Java methods in R

2011-04-27 Thread lcn
I guess your failure of getting two dimensional array may be related to this : http://www.rforge.net/rJava/news.html "0.9-0 (under development) o fixes issues introduced by several new features in the late 0.8 series. Most imporantly .jarray() and .jevalArray() behave as int

Re: [R] Using Java methods in R

2011-04-26 Thread hill0093
Thanks Icn for pointing that out, but I don't understand it. My use of .jcall to return a type double scalar or String worked. My use of .jfield to get a one dimensional static array worked. My use of .jfield to get a static scalar constant did not work. My use of .jfield to get a two dimensional s

Re: [R] Using Java methods in R

2011-04-25 Thread lcn
> for(i in 1:3) for(j in 1:4) print(ar34Ret(i,j),digits=15) >Error in print(ar34Ret(i, j), digits = 15) : > could not find function "ar34Ret" The way you used ar34Ret(i, j) was actually wrong. It should be ar34Ret[i, j], if nothing else wrong. At 2011-04-25 08:06:51£¬hill0093 wrote: >I added

Re: [R] Using Java methods in R

2011-04-25 Thread lcn
you should take a look at the doc of .jarray by input "?.jarray" in the console and see related examples by "example(.jarray)" in the console. This is what the doc says, and your issues might be related to it: '.jevalArray' currently supports only a subset of all possible array types. R

Re: [R] Using Java methods in R

2011-04-25 Thread hill0093
So the first few posts show that I found out how to get Java functions to return type double numbers to R. The arrays are still a problem. Here is another of my attempts to understand how to get java arrays into R. The Java code in class CalqsLin for an array of constants named conArr and for a

Re: [R] Using Java methods in R

2011-04-24 Thread hill0093
I added this R code to the bottom of the previous code and it doesn't work > ar34Ret <- .jcall(qsLin,returnSig="[[D","arReturnTEST") > print(ar34Ret,digits=20) [[1]] [1] "Java-Array-Object[D:[D@8813f2" [[2]] [1] "Java-Array-Object[D:[D@1d58aae" [[3]] [1] "Java-Array-Object[D:[D@83cc67" > for(i

Re: [R] Using Java methods in R

2011-04-24 Thread hill0093
So I am one step farther than last time, so I am happy: I have the RGui with R Console on the screen. On the top pullDowns, Packages > Install Packages > USA(IA)> rJava > library(rJava) > .jinit() > .jaddClassPath("C:/ad/j") > print(.jclassPath()) [1] "C:\\Users\\ENVY17\\Documents\\R\\win-library\

Re: [R] Using Java methods in R

2011-04-24 Thread hill0093
Thanks Icn, for suggesting .jaddClassPath I finally had time to play around and discover what you meant. So I am one step farther than the report in the second post above: I have the RGui with R Console on the screen. On the top pullDowns, Packages > Install Packages > USA(IA)> rJava > library(rJa

Re: [R] Using Java methods in R

2011-04-23 Thread hill0093
Hi Shekhar, Thank you. Right path. Sounds good. Please help me when you discover Java interface. Firstly, I don't know what the R symbol table is or how to do the checking you suggest. I am really naive about R. I want to be able to get my data in there so I can learn to use it for my purposes.

Re: [R] Using Java methods in R

2011-04-23 Thread Shekhar
Hi Hill, I just finished interfacing the C++ with R, i.e. c++ functions from R and vice versa. Next thing in pipe line is Java and python. I just wanted to share some of the things which i think might be useful for you. Reason being whether its a C++, java or any other compiled language the interfa

Re: [R] Using Java methods in R

2011-04-23 Thread lcn
Well, the call to Java methods should be really simple in rJava. What you had tried is actually correct, initialize jvm, create an object, then call method. For the error you met, maybe you should check .jaddClassPath. At 2011-04-23 20:58:22£¬hill0093 wrote: >That's more than I can understand

Re: [R] Using Java methods in R

2011-04-23 Thread Mike Marchywka
> From: marchy...@hotmail.com > To: hill0...@umn.edu; r-help@r-project.org > Date: Sat, 23 Apr 2011 15:12:30 -0400 > Subject: Re: [R] Using Java methods in R > > > > > > > > > > > > > > &

Re: [R] Using Java methods in R

2011-04-23 Thread Mike Marchywka
> Date: Sat, 23 Apr 2011 05:32:59 -0700 > From: hill0...@umn.edu > To: r-help@r-project.org > Subject: Re: [R] Using Java methods in R > > No answer to my post, > so let's try a simpler question. Am I doing this co

Re: [R] Using Java methods in R

2011-04-23 Thread hill0093
Since it cannot find a java class that is on my disk, is there a place I have to put it into first? -- View this message in context: http://r.789695.n4.nabble.com/Using-Java-methods-in-R-tp3469299p3470350.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] Using Java methods in R

2011-04-23 Thread hill0093
That's more than I can understand. I just need help from someone who knows. Should be a simple answer from that person. -- View this message in context: http://r.789695.n4.nabble.com/Using-Java-methods-in-R-tp3469299p3469882.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] Using Java methods in R

2011-04-23 Thread Gabor Grothendieck
On Sat, Apr 23, 2011 at 8:32 AM, hill0093 wrote: > No answer to my post, > so let's try a simpler question. Am I doing this correctly? > I have the RGui with R Console on the screen. > On rhe top pullDowns, Packages > Install Packages > USA(IA)> rJava >> library(rJava) >> .jinit() >> qsLin <- .jne

Re: [R] Using Java methods in R

2011-04-23 Thread hill0093
No answer to my post, so let's try a simpler question. Am I doing this correctly? I have the RGui with R Console on the screen. On rhe top pullDowns, Packages > Install Packages > USA(IA)> rJava > library(rJava) > .jinit() > qsLin <- .jnew("C:/ad/j/CalqsLin") Error in .jnew("C:/ad/j/CalqsLin") :