Using the COM servers

Both R(D)COM Server and the package rcom provide COM objects for access to R from 3rd party applications. Both COM server applications implement the same COM interface (IStatConnector). Applications using R(D)COM Server always program against the interface IStatConnector just as applications using rcom do.

This means, that most applications written for R(D)COM Server can easily be adapted to make use of rcom as a COM server. This is a real advantage in the development phase where the R window will provide a very good debugging interface.

Creating COM objects

COM objects are created by instantiating objects implemented in a so-called coclass. There are different ways to identify a coclass.

The identifiers for R(D)COM Server and rcom always mean the identifiers for the coclasses of the IStatConnector implementation.


Every coclass is identified by an so-called class id (CLSID). The CLSID is a GUID (globally unique identifier), which basically is a 128-bit number created by the tool uuidgen.

* The CLSID for R(D)COM Server is 18c8b662-81a2-11d3-9254-00e09812f727. In C or C++ programs, the structure definition can be used. This is const CLSID CLSID_StatConnector = {0x18c8b662,0x81a2,0x11d3,{0x92,0x54,0x00,0xe0,0x98,0x12,0xf7,0x27}};

* The CLSID for rcom is 3660c348-df59-4ca2-83e8-3a913a9fbc77. The structure definition is const CLSID CLSID_InternalConnector = {0x3660c348,0xdf59,0x4ca2,{0x83,0xe8,0x3a,0x91,0x3a,0x9f,0xbc,0x77}};


There is a – more ore less – human readable form of the CLSID available, too. This is called the ProgId. There is both a version-independent and a version-dependent ProgId.

Using the version-independent ProgId advises COM to use the latest version which is installed. By specifying a version-dependent ProgId you can make sure that a special version of the implementation is used. It is recommended to use the version-independent ProgId.

* The version-independent ProgId for R(D)COM Server is STATCONNECTORSRVLib.StatConnector.

* The version-independent ProgId for rcom is RCOMServerLib.InternalConnector.

Remote use of R(D)COM Servers

I found the following references to be of help when trying to learn about accessing R on a remote machine under Windows:

From the useR 2006 workshop: (starting at page 51)

and the following thread on the r-com mailing list:

The relevant bits in the documentation appear to me to be the following:

Personal Tools