public RService()
: base()
{
string RLogFilename = DirectoryHelper.GetLogFileName();
this._log = new RDotNetConsoleLogDevice();
this._log.LogDevice = new Journal() { FileName = RLogFilename };
logService.WriteToLogLevel("R DotNet Server (deepest function call) initialization started.", LogLevelEnum.Info);
try
{
StartupParameter sp = new StartupParameter();
REngine.SetEnvironmentVariables(null, null );//can set R Path and R Home by passing params
this._RServer = REngine.GetInstance();//null, true, null, _log);
this._RServer.Initialize();
logService.WriteToLogLevel("R DotNet Server initialized.", LogLevelEnum.Info); //writes to ApplicationLog
_log.WriteConsole("R.Net Initialized!!!", 1024, RDotNet.Internals.ConsoleOutputType.None); //writes to RLog
}
catch (Exception ex)
{
_log.WriteConsole("Unable to initialize R Server.(note: 64bit R must already be present)", 5, RDotNet.Internals.ConsoleOutputType.None);//Added by Anil
logService.WriteToLogLevel("Unable to initialize R Server.", LogLevelEnum.Error, ex);
throw new Exception();
}
logService.WriteToLogLevel("R DotNet Server (deepest function call) initialization ended.", LogLevelEnum.Info);
}