Quantcast
Channel: R.NET
Viewing all articles
Browse latest Browse all 1634

New Post: REngine.CreateInstance

$
0
0
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.

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();
    }
}
}

Viewing all articles
Browse latest Browse all 1634

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>