Home:ALL Converter>Rjava/Rserve pass arguments from java to R

Rjava/Rserve pass arguments from java to R

Ask Time:2015-11-10T09:24:59         Author:sset

Json Formatter

I am unable to pass string argument from Java to R:

RConnection connection = new RConnection();
connection.eval(String.format("trainingDataPath%s'","C:\\\\software\\\\"));
        connection.eval("source('C:\\\\software\\\\svm.R')"); Get an error object trainingDataPath does not exist in Rserve...Guess parse error.
kindly help
in R
dataText<-read.csv(paste(trainingDataPath,"RiskText.csv",sep=""),header= TRUE)

Author:sset,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/33621327/rjava-rserve-pass-arguments-from-java-to-r
yy