Reputation: 541
The following didn't work for me. Simply crashes with no exception caught.
REngine engine = null;
try
{
REngine.SetEnvironmentVariables(@"C:\Program Files\R\R-3.2.3\bin\x64", Directory.GetCurrentDirectory());
engine = REngine.GetInstance();
}
catch (Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
Console.ReadKey();
return;
}
I installed R for Windows version 3.2.3 without the registry option.
I am using R.NET.Community version 1.6.5 targeting .NET framework 4.0.
I tried the path @"C:\Program Files\R\R-3.2.3\bin\i386" as well and I get
%1 is not a valid Win32 application Error: This 64-bit process failed to load the library R.dll. Native error message is 'The system cannot find the file specified'
Thank you for any advice.
Upvotes: 3
Views: 2616
Reputation: 541
Ok I got it working.
You need to target the 64-bit version of R. I read somewhere the recent R developments are geared towards 64-bit Windows.
You need the registry entries. You can do so by executing RSetReg.exe in the R bin directory.
After that, simply do this and it will work:
REngine.SetEnvironmentVariables();
engine = REngine.GetInstance();
I have tested this on R 3.2.3 and RRO 3.2.2 and they both work with Rdotnet 1.6.5.
Upvotes: 4