我需要将 R 连接到某些 C# 应用程序。我安装了rscproxy_1.3
and R_Scilab_DCOM3.0-1B5
添加了 COM 引用STATCONNECTORCLNTLib
, StatConnectorCommonLib
and 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)
提前致谢。
UPDATE:好吧,还是没有运气。
我将尝试解释到目前为止我所做的事情。
安装 R-2.12.2-win.exe 从
r 投影到C:\Program
Files\R\R-2.12.2
下载 rscproxy_1.3-1.zip 并
将其复制/粘贴到C:\Program
Files\R\R-2.12.2\library
安装 R_Scilab_DCOM3.0-1B5.exe 到
这C:\Program Files (x86)\R\(D)COM
Server
Scilab 提供了基本测试。我尝试运行它,但出现以下错误:
正在加载 StatConnector 服务器...完成
正在初始化 R...函数调用失败
代码:-2147221485 文本:安装
问题:无法加载连接器
释放 StatConnector 服务器...完成
我查看了 PATH/系统变量,发现没有路径/R_HOME/R_USER 信息。另外,我在注册表中找不到任何与 R 相关的内容。
我想我做错了什么,所以我迫切需要你们的帮助。
你可以看看R.NET http://rdotnet.codeplex.com/,另一种方法...
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)