我的RConnection产生错误

时间:2011-05-18 07:07:39

标签: java r

//import org.rosuda.REngine.REXP;
//import org.rosuda.REngine.Rserve.RConnection;
public class RConnectionFromJava {

  public static void main(String args[])
  {
    try{

      System.out.println("INFO: Trying to connect to R ");
      RConnection c = new RConnection();
      System.out.println("INFO: Connected to R ");
      System.out.println("INFO: The Server version is "+ c.getServerVersion());

      c.close();
    }
    catch(Exception e)
    {
      System.out.println("ERROR: In Connection to R ");
      System.out.println("The Exception is "+ e.getMessage());
      e.printStackTrace();
    }
  }
}

这给RConnection带来了错误。你能告诉我为什么会出现这个错误吗?

1 个答案:

答案 0 :(得分:1)

import org.rosuda.REngine.Rserve.RConnection;

之前删除//