3

I am building an application within C# and I want to use some of the R libraries within this application. I am using R.Net to do this.

However, I will deploy this software to users that may not have R downloaded on there computers. Is there any way that I can use the R dll so that the users can run my application without having to install R onto there machines?

Many thanks

Daniel Wyatt
  • 960
  • 1
  • 10
  • 29
  • 2
    As per the docs: On Windows, R.NET requires .NET Framework 4.5.2 and an access to the native R libraries installed with the R environment. R needs not necessarily be installed as a software on the executing machine, so long as DLL files are accessible. On Linux and MacOS, Mono is required, as well as an access to the native R libraries. – Hackerman Oct 24 '18 at 14:30
  • Are the relevant DLL files just R.dll along with any of the packages used? – Daniel Wyatt Oct 24 '18 at 14:50
  • AFAIK you just need the dll included with the nuget package and that's it – Hackerman Oct 24 '18 at 16:11

1 Answers1

2

While this question is rather old, maybe this elaboration on Hackerman's answer will still help someone:

You do not have to have R installed properly on your computer and you also do not have to have any registry entries for R if you want to use R.NET. However, R.NET still needs to access the native DLLs found in ...\R\bin\i386 and the contents of ...\R\library.

Assuming your R files are located at C:\Program Files, setting the paths to ...\R\bin\i386 and ...\R\library works as follows:

REngine.SetEnvironmentVariables(@"C:\Program Files\R\bin\i386", @"C:\Program Files\R");

You can then set up an REngine using:

REngine engine = REngine.GetInstance();

This works using R.NET v1.7 and R v3.4.2 (32bit).

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
Hunter2
  • 35
  • 1
  • 8