问题
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
回答1:
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).
来源:https://stackoverflow.com/questions/52971485/can-i-use-r-net-without-installing-r