Skip to main content

Posts

Showing posts from December, 2014

Accessing R script from Java

R is powerful language for statistical analysis and Machine Learning. Java is best suited to develop enterprise applications. Integrating both could lead to developing powerful analytic applications. In this tutorial we are going to call a R script from java, then pass the parameters from java to R and fetch back the results from R to Java. Problem Statement: In this tutorial we have a csv file 'data.csv' having 4 columns and we need to calculate mean of few user defined columns. To calculate the mean we will be using and then we will pass the calculated mean back to Java. Pre-requisites:  1. You should know how to integrate R with Java. For that you could consult the tutorial http://rajeev0401.blogspot.in/2013/10/using-r-programming-language-inside-java.html Code Files: We will be needing following files: 1. data.csv: file having data that will be used in R script. 2. config.R: this file contains the configuration (vector having column index) to be used in 'test