tags:

views:

150

answers:

1

I am trying to get the rcom package for R working. It seems to have installed ok:

> install.packages("rcom");
--- Please select a CRAN mirror for use in this session ---
trying URL 'http://mira.sunsite.utk.edu/CRAN/bin/windows/contrib/2.9/rcom_2.2-1.zip'
Content type 'application/zip' length 204632 bytes (199 Kb)
opened URL
downloaded 199 Kb

package 'rcom' successfully unpacked and MD5 sums checked

The downloaded packages are in
        C:\Users\solomon\AppData\Local\Temp\Rtmpzb5oi4\downloaded_packages
updating HTML package descriptions

Then I try to run something:

>comCreateObject("Excel.Application");
Error: could not find function "comCreateObject"

What am I missing, the manual tells me that comCreateObject is the appropriate command. However, the manual's version is somewhat old. Anyone else have any insights?

+5  A: 

I can see a couple of potential problems here - rcom has a weird installation.

  1. Did you load the package - that is, run library(rcom) after installing it? I know, I know - but I forget that step all the time, and it would definitely give you the "could not find function" error.

  2. Did you run the installstatconnDCOM() command? I almost didn't notice it telling me to do this.

Matt Parker
not running library(rcom) is very likely the problem
Thierry
That helped me get started. However, it got more complex. I had an old version of R and some DCOM for R installer that prevented statconnDCOM from installing. Also, for some reason, the version of rcom was old from the mirror I was using.Note: sysinternals DebugViewer is your friend for RCOM.
User1
For clarification, comCreateObject works even when installstatconnDCOM() failed. So, it appeared that statconnDCOM actually installed okay.
User1