简体   繁体   English

我可以在不安装R的情况下使用R.Net

[英]Can I use R.Net without installing R

I am building an application within C# and I want to use some of the R libraries within this application. 我正在C#中构建一个应用程序,我想在这个应用程序中使用一些R库。 I am using R.Net to do this. 我正在使用R.Net来做这件事。

However, I will deploy this software to users that may not have R downloaded on there computers. 但是,我会将此软件部署到可能没有在计算机上下载R的用户。 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? 有没有什么办法可以使用R dll,这样用户可以运行我的应用程序,而无需在那里的机器上安装R?

Many thanks 非常感谢

While this question is rather old, maybe this elaboration on Hackerman's answer will still help someone: 虽然这个问题相当陈旧,但对Hackerman的答案的详细阐述仍然可以帮助某些人:

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. 您不必在计算机上正确安装R,如果要使用R.NET,也不必为R安装任何注册表项。 However, R.NET still needs to access the native DLLs found in ...\\R\\bin\\i386 and the contents of ...\\R\\library. 但是,R.NET仍然需要访问... \\ R \\ bin \\ i386中的本机DLL和... \\ 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: 假设您的R文件位于C:\\ Program Files,将路径设置为... \\ R \\ bin \\ i386和... \\ R \\ library的工作原理如下:

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

You can then set up an REngine using: 然后,您可以使用以下命令设置REngine:

REngine engine = REngine.GetInstance();

This works using R.NET v1.7 and R v3.4.2 (32bit). 这适用于使用R.NET v1.7和R v3.4.2(32位)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM