[Rd] rJava is not working in Solaris through java

From: Praveen Kumar <prawin.pop_at_gmail.com>
Date: Fri, 21 Dec 2012 02:46:50 -0800 (PST)


Hi,

we have installed R in solaris 10 sparc machine. After installing R we have installed rJava package and we did a sample test using R prompt it worked well. We have written sample Java class to calculate GLM and LM functions. When we execute the sample java class it returns null for both the functions. But both the functions are working fine in R console.

sample java class code.

import org.rosuda.JRI.REXP;
import org.rosuda.JRI.RVector;
import org.rosuda.JRI.Rengine;


public class rtest {
        static Rengine re;
 
        public static void main(String []a)
        {
                try

{
re = new Rengine(a, false, null); REXP x11 = re.eval("a<-sample(1:1000,300)"); REXP x12 = re.eval("b<-sample(1:1000,300)"); REXP x13 = re.eval("d<-sample(1:1000,300)"); REXP x14 = re.eval("f<-runif(1:300)"); re.eval("value<-glm(f~a+b+d,family=binomial)"); REXP x1 = re.eval("value"); REXP x2 = re.eval("coef(value)"); System.out.println(x1); System.out.println(x2); REXP x111 = re.eval("aa<-c(5,1,3,4,2)"); REXP x112 = re.eval("bb<-c(7,8,6,9,4)"); REXP x113 = re.eval("dd<-c(1,0,1,0,1)"); REXP x114 = re.eval("lm(dd~aa+bb)"); System.out.println(x111); System.out.println(x112); System.out.println(x113); System.out.println(x114); } catch(Exception e)
{
e.printStackTrace(); re.end(); //s.end(); } finally
{
re.end(); //s.end(); } }

}

Thanks in advance.

by,
Praveen Kumar

--
View this message in context: http://r.789695.n4.nabble.com/rJava-is-not-working-in-Solaris-through-java-tp4653701.html
Sent from the R devel mailing list archive at Nabble.com.

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Fri 21 Dec 2012 - 12:43:58 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 21 Dec 2012 - 14:43:03 GMT.

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

list of date sections of archive