I can run the R-script below from the Windows-command line. The script loads a fitted neuralnet from my harddisk and makes a prediction based on x1 and x2.
Although I do not see nnetTune in the Global Environment (which would be the case if I run the code from the R-Console). If I call the script again without the line load("D:/nnetTune.rda") it does not work since it needs nnetTune. I don't want to load nnetTune again every time I run the script. My questions are:
1) Where is nnetTune if it is not loaded visible in the Global Environment? 2) Is there a method so I need only once to load nnetTune into memory and not for every call from the script?
x1 <- 12
x2 <- 22
load("D:/nnetTune.rda")
xx <- data.frame(x1, x2)
names(xx) <- c("predictor1","predictor2")
z <- predict(nnetTune, xx)
z
I have checked these posts although I can't find an answer:
http://shashiasrblog.blogspot.com/2013/10/vba-front-end-for-r.html
Run R script from command line
Thanks!