Can I use R.Net without installing R

时光毁灭记忆、已成空白 提交于 2019-12-12 13:44:25

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!