Necesito conectar R a alguna aplicación C#. Instalé rscproxy_1.3
y R_Scilab_DCOM3.0-1B5
añadí referencias COM al STATCONNECTORCLNTLib
, StatConnectorCommonLib
y STATCONNECTORSRVLib
pero todavía no puedo hacer que funcione.C# - Interfaz R
cuando corro siguiente programa de prueba:
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");
}
}
}
me sale esta excepción:
Unhandled Exception: System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x80040013
at STATCONNECTORSRVLib.StatConnectorClass.Init(String bstrConnectorName)
Gracias de antemano.
ACTUALIZACIÓN: Ok, todavía no hubo suerte. Trataré de explicar lo que hice hasta ahora.
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
Con Scilab viene una prueba básica. Traté de correr, pero llegué siguiente error:
Loading StatConnector Server... Done Initializing R...Function call failed Code: -2147221485 Text: installation problem: unable to load connector Releasing StatConnector Server...Done
De lo que miraba en las variables de ruta/del sistema y no encontró ninguna ruta/R_HOME/R_USER información. Además, no pude encontrar nada relacionado con R en el registro.
Supongo que estoy haciendo algo terriblemente malo, por lo que necesito desesperadamente ayuda de ustedes.
Ver http://stackoverflow.com/questions/12834704/exception-from-hresult-0x80040013-when-intregating-r-with-c – Contango