Starting rcom automatically

It is useful to start rcom whenever RGui is started. Then, one can start Excel later and have it communicating with R.

To do this, the file $RHOME\etc\Rprofile.site

has to contain the line

library(rcom)

Using rcom to access from R applications other than Excel

dBank is an excellent time series database designed by Philip Ouliaris It is accessed via COM from VBA and other languages.

http://www.tsdbank.com/

We are not interested in the Excel add-in, could we manipulate it directly from R?

How to access if from R?

library(rcom)

x ← comCreateObject(“DbankEngine.dbTimeSeries”)

i ←comGetObjectInfo(x)

str(i)

work nicely, but what else?

In Windev we can do:

y is object Automation “DbankEngine.dbTimeSeries”

y»Frequency = “Q”

y»Nobs=100

y»StartDate=“1968:4”

#Fill time series y

j is int

FOR j = 1 TO y»Nobs

y>>DataValue(j)=j	

END

Info(y»DataValue(“1969:1”)) #2

y»read(“f:\Dbank32\example[ace]a”)

Info(y»DataBank) #“f:\DBank32\example”

How to get the same output with rcom?

For example:

comInvoke(y, “Read”,“F\\Dbank32\\example[ace]a”) returns NULL

which is not useful.

The R help for rcom has not examples of use from within R.


Personal Tools