I need to interface R to some C# application. I installed rscproxy_1.3
and R_Scilab_DCOM3.0-1B5
added COM references to the STATCONNECTORCLNTLib
, StatConnectorCommonLib
and STATCONNECTORSRVLib
but I still cannot get it working.
When I run following test program:
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"); } } }
I get this exception:
Unhandled Exception: System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x80040013 at STATCONNECTORSRVLib.StatConnectorClass.Init(String bstrConnectorName)
Thanks in advance.
UPDATE: Ok, still no luck. I will try to explain what I did so far.
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
With Scilab comes a basic test. I tried to run it but I got following error:
Loading StatConnector Server... Done Initializing R...Function call failed Code: -2147221485 Text: installation problem: unable to load connector Releasing StatConnector Server...Done
Than I looked in the PATH/System Variables and found no path/R_HOME/R_USER info. Also, I couldn't find anything R related in the registry.
I guess I am doing something terribly wrong, so I desperately need help from you guys.
C programming language is a machine-independent programming language that is mainly used to create many types of applications and operating systems such as Windows, and other complicated programs such as the Oracle database, Git, Python interpreter, and games and is considered a programming foundation in the process of ...
In the real sense it has no meaning or full form. It was developed by Dennis Ritchie and Ken Thompson at AT&T bell Lab. First, they used to call it as B language then later they made some improvement into it and renamed it as C and its superscript as C++ which was invented by Dr.
What is C? C is a general-purpose programming language created by Dennis Ritchie at the Bell Laboratories in 1972. It is a very popular language, despite being old. C is strongly associated with UNIX, as it was developed to write the UNIX operating system.
C is a general-purpose language that most programmers learn before moving on to more complex languages. From Unix and Windows to Tic Tac Toe and Photoshop, several of the most commonly used applications today have been built on C. It is easy to learn because: A simple syntax with only 32 keywords.
You can have a look at R.NET, for another approach...
Ok, I solved it finally. The problem is that R (D)Com doesn't work with current version of R. I installed 2.11.1 and it worked out of box.
Thanks a lot.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With