我可以在不安装R的情况下使用R.Net吗? [英] Can I use R.Net without installing R
问题描述
我正在C#中构建一个应用程序,并且我想在此应用程序中使用某些R库.我正在使用R.Net来做到这一点.
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.
但是,我将把该软件部署到可能没有在该计算机上下载R的用户.有什么方法可以使用R dll,以便用户可以运行我的应用程序而不必将R安装到那里的计算机上?
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?
非常感谢
推荐答案
虽然这个问题比较老,但对Hackerman答案的阐述仍将对某人有所帮助
While this question is rather old, maybe this elaboration on Hackerman's answer will still help someone:
如果您要使用R.NET,则不必在计算机上正确安装R,并且也不必具有R的任何注册表项.但是,R.NET仍然需要访问... \ R \ bin \ i386中存在的本机DLL和... \ R \ library的内容.
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.
假设您的R文件位于C:\ Program Files,则将路径设置为... \ R \ bin \ i386和... \ 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");
然后您可以使用以下命令设置REngine:
You can then set up an REngine using:
REngine engine = REngine.GetInstance();
这可以在R.NET v1.7和R v3.4.2(32位)下使用.
This works using R.NET v1.7 and R v3.4.2 (32bit).
这篇关于我可以在不安装R的情况下使用R.Net吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!