I'm using RCaller in order to call R from java programs The pc where I'm trying to call R by using RCaller can't access to Internet; now I have this situation: from Java I write me R code and, by using RCode I add this code to R; the generated code is this one:
packageExist<-require(Runiversal)
if(!packageExist){
install.packages("Runiversal", repos=" http://cran.r-project.org")
}
source("/tmp/liveness/helper.R")
source("/tmp/liveness/model-nbd.R")
source("/tmp/liveness/model-pareto-nbd.R")
source("/tmp/liveness/model-bg-nbd.R")
source("/tmp/liveness/model-cbg-cnbd-k.R")
cdData <- read.table("/tmp/liveness/data.csv", head=T)
names(cdData)[2] <- "x";
bgMleFit <- bgEstimateParameters(cdData, list(r=1, alpha=2, a=1, b=2));
summary(bgMleFit);
cdBgParams <- as.list(coef(bgMleFit));
t <- 2;
cdBgCe <- bgConditionalForecast(cdData, cdBgParams, t);
cat(makexml(obj=cdBgCe, name="cdBgCe"), file="/tmp/Routput7266683884330110613")
By executing this code in the Java program I have an exception when I try to parse the XML file because the generate XML file is empty If I copy the generated code and paste it in RStudio all works pretty good