Examples of asIntArray()


Examples of org.rosuda.JRI.REXP.asIntArray()

      // get boolean array
      System.out.println(x=re.eval("iris[[1]]>mean(iris[[1]])"));
      // R knows about TRUE/FALSE/NA, so we cannot use boolean[] this way
      // instead, we use int[] which is more convenient (and what R uses internally anyway)
      int[] bi = x.asIntArray();
      {
          int i = 0; while (i<bi.length) { System.out.print(bi[i]==0?"F ":(bi[i]==1?"T ":"NA ")); i++; }
          System.out.println("");
      }
     
View Full Code Here

Examples of org.rosuda.JRI.REXP.asIntArray()

            System.out.println("");
        }
        {
            REXP x=re.eval("1:10");
            System.out.println("REXP result = "+x);
            int d[]=x.asIntArray();
            if (d!=null) {
                int i=0; while (i<d.length) { System.out.print(((i==0)?"":", ")+d[i]); i++; }
                System.out.println("");
            }
        }
View Full Code Here

Examples of org.rosuda.JRI.REXP.asIntArray()

      // get boolean array
      System.out.println(x=re.eval("iris[[1]]>mean(iris[[1]])"));
      // R knows about TRUE/FALSE/NA, so we cannot use boolean[] this way
      // instead, we use int[] which is more convenient (and what R uses internally anyway)
      int[] bi = x.asIntArray();
      {
          int i = 0; while (i<bi.length) { System.out.print(bi[i]==0?"F ":(bi[i]==1?"T ":"NA ")); i++; }
          System.out.println("");
      }
     
View Full Code Here

Examples of org.rosuda.JRI.REXP.asIntArray()

            System.out.println("");
        }
        {
            REXP x=re.eval("1:10");
            System.out.println("REXP result = "+x);
            int d[]=x.asIntArray();
            if (d!=null) {
                int i=0; while (i<d.length) { System.out.print(((i==0)?"":", ")+d[i]); i++; }
                System.out.println("");
            }
        }
View Full Code Here

Examples of org.rosuda.JRI.REXP.asIntArray()

    }
 
    public static int evalInt(String evalstr) {
        REXP x = getRengine().eval(evalstr);

        if (x != null && x.asIntArray() != null) {
            return x.asIntArray()[0];
       
        log.error("Error while evaling" + evalstr);
        return -1;
    }
View Full Code Here

Examples of org.rosuda.JRI.REXP.asIntArray()

 
    public static int evalInt(String evalstr) {
        REXP x = getRengine().eval(evalstr);

        if (x != null && x.asIntArray() != null) {
            return x.asIntArray()[0];
       
        log.error("Error while evaling" + evalstr);
        return -1;
    }
 
View Full Code Here

Examples of org.rosuda.JRI.REXP.asIntArray()

      // get boolean array
      System.out.println(x=re.eval("iris[[1]]>mean(iris[[1]])"));
      // R knows about TRUE/FALSE/NA, so we cannot use boolean[] this way
      // instead, we use int[] which is more convenient (and what R uses internally anyway)
      int[] bi = x.asIntArray();
      {
          int i = 0; while (i<bi.length) { System.out.print(bi[i]==0?"F ":(bi[i]==1?"T ":"NA ")); i++; }
          System.out.println("");
      }
     
View Full Code Here

Examples of org.rosuda.JRI.REXP.asIntArray()

            System.out.println("");
        }
        {
            REXP x=re.eval("1:10");
            System.out.println("REXP result = "+x);
            int d[]=x.asIntArray();
            if (d!=null) {
                int i=0; while (i<d.length) { System.out.print(((i==0)?"":", ")+d[i]); i++; }
                System.out.println("");
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.