I am trying to implement clustering using R in java by employing R caller. I am trying to run sample code for clustering validation and I get that common error faced by most of the users: Premature end of file
package test;
import rcaller.RCaller;
import java.io.File;
import java.lang.*;
import java.util.*;
import java.awt.image.DataBuffer;
public class test3 {
public static void main(String[] args) {
new test3();
}
public test3()
{
try{
RCaller caller = new RCaller();
caller.cleanRCode();
caller.setRscriptExecutable("C:/Program Files/R/R-2.15.1/bin/x64/Rscript");
caller.cleanRCode();
caller.addRCode("library(clvalid)");
caller.addRCode("data(mouse)");
caller.addRCode("express <- mouse [,c(M1,M2,M3,NC1,NC2,NC3)]");
caller.addRCode("rownames (express) <- mouse$ID ");
caller.addRCode("intern <- clValid(express, 2:6 , clMethods = c( hierarchical,kmeans,diana,clara,model) ,validation = internal)");
caller.addRCode("b <- summary(intern) ");
caller.runAndReturnResult("b");
}
catch (Exception e){
e.printStackTrace();
}
}
}