Situation: I have installed R 3.3 and set up R for Visual Studio extension.
Code snippet:
log.ir <- log(iris[, 1:4])
ir.species <- iris[, 5]
ir.pca <- stats:::prcomp(log.ir, center = TRUE, scale = TRUE)
This works in R interactive window in Visual Studio, it also work in RGui but when I run it using C# the code fails on 3rd line:
engine.Evaluate("log.ir <- log(iris[, 1:4])");
engine.Evaluate("ir.species <- iris[, 5]");
engine.Evaluate("ir.pca <- stats:::prcomp(log.ir, center = TRUE, scale = TRUE)");
Exception:
Error in inDL(x, as.logical(local), as.logical(now), ...) : unable to load shared object 'C:/Program Files/R/R-3.3.3/library/stats/libs/x64/stats.dll': LoadLibrary failure: The specified module could not be found.
I have tried reinstalling all R components but it hasn't helped. And obviously I have checked and the stats.dll file exists in the path specified in the error.
Any help is much appreciated, Thanks