This thread attracted my attention as I have a related problem with
REngine engine = REngine.GetInstance();
Using the NuGet package manager with Visual Studio, I have installed
R.Net.Community (v1.6.5) and its dependency DynamicInterop (v.0.7.4).
In my case, REngine.GetInstance fails with the exception:
Windows Registry key 'SOFTWARE\R-core' not found in HKEY_LOCAL_MACHINE nor HKEY_CURRENT_USER
I've installed the system on several machines and the same error appears.
I have also tried setting rHome and rPath explicitly as shown in the code snippet below, but another
exception appears:
An unhandled exception of type 'System.Exception' occurred in DynamicInterop.dll
Additional information: This 32-bit process failed to load the library R.dll.
Native error message is 'The specified module could not be found'
However, I have confirmed that R.dll does exist in the specified folder.
using System.IO;
using RDotNet;
namespace ConsoleApplication1
{
REngine engine = REngine.GetInstance();
Using the NuGet package manager with Visual Studio, I have installed
R.Net.Community (v1.6.5) and its dependency DynamicInterop (v.0.7.4).
In my case, REngine.GetInstance fails with the exception:
Windows Registry key 'SOFTWARE\R-core' not found in HKEY_LOCAL_MACHINE nor HKEY_CURRENT_USER
I've installed the system on several machines and the same error appears.
I have also tried setting rHome and rPath explicitly as shown in the code snippet below, but another
exception appears:
An unhandled exception of type 'System.Exception' occurred in DynamicInterop.dll
Additional information: This 32-bit process failed to load the library R.dll.
Native error message is 'The specified module could not be found'
However, I have confirmed that R.dll does exist in the specified folder.
I am grateful for a solution or any helpful suggestions.
using System;using System.IO;
using RDotNet;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
string rHome = @"C:\Program Files\R\R-3.1.3";
string rPath = Path.Combine(rHome, @"bin\x64");
REngine.SetEnvironmentVariables(rHome, rPath);
// There are several options to initialize the engine, but by default the following suffice:
REngine engine = REngine.GetInstance();
engine.Dispose();
}
}
}