rConnection.eval("dataframe1 <- data.frame(x,y)");
rConnection.eval("HCluster <- hclust(d = dist(dataframe1), method)");
// option for drawing the hierarchical tree and storing the image
rConnection.assign(".tmp.", docrootPath + rFolderName + "/Hierarchical_Clustering.jpg");
rConnection.eval("jpeg(.tmp.)");
rConnection.eval("plot(HCluster, main = \"Hierarchical Clustering\")");
rConnection.eval("dev.off()");
// Get the data from R
hclresult.setClusterSequence(rConnection.eval("HCluster$merge").asDoubleMatrix());