如何从.NET调用R以保存结果,以便在以后的时间以编程方式使用它 [英] How to call R from .NET to save the result for using it programmatically at later point of time

查看:87
本文介绍了如何从.NET调用R以保存结果,以便在以后的时间以编程方式使用它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是.NET开发人员,也是R的新手。我们有一个现有的R脚本,它根据excel的一些输入生成pdf格式的annova决策树。对于给定的标准,人们手动解析树并获取节点值并将其用于
目的。我们现在需要自动化这个过程。我有两个要求

1.首先,我需要从.net程序调用R exe或库。 

2.上述调用的树结果应存储在数据库或文件系统中,需要在以后的时间点以编程方式重新使用。 

3.在以后的某个时间点,需要加载和解析上面的树结果树以编程方式获取给定条件并获取节点值。 
$


我安装了Microsoft R open和R studio,RST的VSTS工具。请告诉我工具/库和实现上述要求的方法。 

解决方案

您好,


您刚才提到的要求可以使用R和.Net通过简单的体系结构实现。正如您在要求中提到的那样,这就是我为此解决方案所采用的方法。



  • 设置一个可以托管我的R代码的Deploy R open服务器将它们公开为Web服务。
  • 然后创建一个Web应用程序(或者在用户访问它时您喜欢的任何应用程序),将您的文件上传到Deploy-R服务器。
  • 您的R代码接受输入,计算annova树并将结果存储到数据库中。
  • 用户现在可以输入他的输入以从数据库中检索值。 
  • 您还可以使用.net对树解析进行编程并同时显示给用户。


你可能需要花时间了解整个应用程序如何相互通信。



问候,


阿尼什


I am a .NET developer and new to R. we have an existing R script that generates annova decision tree in pdf format based on some input from excel. For a given criteria, people are manually parsing the tree and getting the node value and using it for their purposes. we need to automate the process now. I have two requirements
1. First, I need to make a call to R exe or library from .net program. 
2. The tree result of above call should be stored in database or filesystem, which needs to be retrived programmatically later point of time for use. 
3. At a later point of time, the above tree result needs to be loaded and parse the tree programmatically for the given criteria and get the node value. 

I installed Microsoft R open and R studio, VSTS tools for R. Please let me know the tools/library and approach to achieve above requirement. 

解决方案

Hello,

The requirement you just mentioned can be achieved with the simple architecture by using R and .Net. As you mentioned in your requirements, this is how I would have approached for this solution.

  • Set up a Deploy R open server which can host my R code and expose them as web-service.
  • Than create a web application (or any application which you like as far as the user is accessing it), Upload your file to the Deploy-R server.
  • Your R code accepts the input, calculate the annova tree and stores the result into the database.
  • User can now enter his inputs to retrieve the values from the database. 
  • You can also program the tree parsing using .net and display to the user at the same time.

You might need to invest time on how the whole application will communicate with each other.

Regards,

Anish


这篇关于如何从.NET调用R以保存结果,以便在以后的时间以编程方式使用它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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