C# - R 界面

标签 c# r

我需要将 R 连接到某些 C# 应用程序。我安装了 rscproxy_1.3R_Scilab_DCOM3.0-1B5 添加了对 STATCONNECTORCLNTLibStatConnectorCommonLib 的 COM 引用>STATCONNECTORSRVLib 但我仍然无法让它工作。

当我运行以下测试程序时:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

//COM references
using STATCONNECTORCLNTLib;
using StatConnectorCommonLib;
using STATCONNECTORSRVLib;

namespace R_TESTING
{
    class Program
    {
        static void Main(string[] args)
        {
            StatConnector sc1 = new STATCONNECTORSRVLib.StatConnectorClass();         
            sc1.Init("R");
        }
    }
}

我得到这个异常:

Unhandled Exception: System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x80040013
   at STATCONNECTORSRVLib.StatConnectorClass.Init(String bstrConnectorName)

提前致谢。

更新: 好的,仍然没有运气。 我将尝试解释我到目前为止所做的事情。

Installed R-2.12.2-win.exe from rproject to the C:\Program Files\R\R-2.12.2

Downloaded rscproxy_1.3-1.zip and copy/pasted it to the C:\Program Files\R\R-2.12.2\library

Installed R_Scilab_DCOM3.0-1B5.exe to the C:\Program Files (x86)\R\(D)COM Server

Scilab 附带一个基本测试。我尝试运行它,但出现以下错误:

Loading StatConnector Server... Done Initializing R...Function call failed Code: -2147221485 Text: installation problem: unable to load connector Releasing StatConnector Server...Done

然后我查看了 PATH/系统变量,没有发现路径/R_HOME/R_USER 信息。另外,我在注册表中找不到任何与 R 相关的内容。

我想我做错了什么,所以我迫切需要你们的帮助。

最佳答案

你可以看看R.NET , 对于另一种方法...

关于C# - R 界面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5377070/

相关文章:

c# - 拾色器不提供渐变外观

c# - 使用扭矩稳定气垫船刚体直立

c# - 为什么我的最小起订量数据库对象没有产生任何结果

r - 在 ggplotly 中保持 x 和 y 比例相同(所以方形图)

r - 我们可以用 purrr 迭代两个列表吗(不是同时)?

r - 从包含缩写月份和 PM(及时)的时间戳转换为日期

c# - 为什么我们在尝试用另一个字符串替换它时将 @ 与 "\"一起使用

c# - 如何从 richtextbox 计算 C# 中的字符数

r - 使用 R 和 rvest 进行网络抓取

r - 连接点