My RConnection produces an error
//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();
}
}
}
This gives an error for RConnection. Could you please tell me why it gives this error?
Remove // before import org.rosuda.REngine.Rserve.RConnection;
精彩评论