如何从C#程序中提取R运行结果 [英] How extract R running result from C # program

查看:79
本文介绍了如何从C#程序中提取R运行结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我是新的.net程序员。我开始使用R,一切都很好。我只想使用工具来使用c#语言提取R结果。


实际上,我使用了R.net包,当我将它命名为在C#中运行R脚本时它很好。 


以下是我的简单代码:

 


< pre class ="prettyprint"style ="">

使用System;
使用System.Linq;
使用RDotNet;

名称空间Sample1
{  &NBSP;课程计划 
  {&NBSP; &NBSP; &NBSP; &NBSP; static void Main(string [] args)  &NBSP; &NBSP; &NBSP;
{  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; REngine.SetEnvironmentVariables();&NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP;  

  REngine engine = REngine.GetInstance();  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP;

engine.Evaluate(" source('C:/ Users / isalah / Desktop / Fichiers_CRM / Modeles / MACHINE_LEARNING_FEATURE_ IMPORTANCE.r)");
}  &NBSP;
}
}

但我还需要查看图表,数值....这些是由R脚本执行的。


请为那些在这些项目中工作的人,包括R和C#之间的互动,给我一些有用的链接来帮助我


如果您直接告诉或推荐我(包裹,代码......)。


Tahnks



 


解决方案

您好user2018,


感谢您发布此处。


对于您的问题,您可以参考下面的MSDN文章。它为带有图形的C#程序员介绍了R。


https: //msdn.microsoft.com/en-us/magazine/mt238409.aspx


如果您还有其他问题,可以在StackOverFlow或GitHub中发布新主题。


StackOverFlow  https://stackoverflow.com/问题/标记/ rdotnet


GitHub  https://github.com/jmp75/rdotnet


最好的问候,


Wendy


I'm new .net programmer. I start working with R and all is fine. I want just tools to extract R results using c # language.

In fact, I used R.net package and It is fine when I call it to run R scripts in C#. 

Here is my simple code below:

using System; using System.Linq; using RDotNet; namespace Sample1 {    class Program    {        static void Main(string[] args)        {            REngine.SetEnvironmentVariables();                   

  REngine engine = REngine.GetInstance();           

engine.Evaluate("source('C:/Users/isalah/Desktop/Fichiers_CRM/Modeles/MACHINE_LEARNING_FEATURE_ IMPORTANCE.r)"); }    } }

But I need also to see graphs, numeric values.... which are executed by R scripts.

Please, for those who were working in such projects including interaction between R and C#, give me useful links to help me

if you know or advance me directly (packages, codes...).

Tahnks

 

解决方案

Hi user2018,

Thank you for posting here.

For your question, you could refer to the MSDN article below. It shows introduction to R for C# Programmers with graphs.

https://msdn.microsoft.com/en-us/magazine/mt238409.aspx

If you have further questions, you could post a new thread in StackOverFlow or GitHub.

StackOverFlow https://stackoverflow.com/questions/tagged/rdotnet

GitHub https://github.com/jmp75/rdotnet

Best Regards,

Wendy


这篇关于如何从C#程序中提取R运行结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆