Serving the Quantitative Finance Community

 
User avatar
Hansi
Topic Author
Posts: 41
Joined: January 25th, 2010, 11:47 am

Using COM objects in R

March 10th, 2011, 10:53 am

Does anyone have any tips on an easy way of working with COM objects in R and exposing them in a manner so they are somewhat explorable? I've been working with Excel as a COM object and a few DLLs but haven't found a good way of actually figuring out if there is a way of exploring the object being pointed at. The only way I've found is to actually know the syntax by heart or reading through uddles of documentation, since if you mess up the syntax you just get a NULL pointer back and no errors or warnings. This is an example of what I'm talking about and as you can see it's not very intuitive:
 
User avatar
Cuchulainn
Posts: 22929
Joined: July 16th, 2004, 7:38 am

Using COM objects in R

March 10th, 2011, 11:21 am

yikes The only thing I can think of is to use .NET wrappers which might be easier?? http://msdn.microsoft.com/en-us/library/8bwh56xe.aspx what about R in .NETThen I would reckon you are almost there, all things being equal.
Last edited by Cuchulainn on March 9th, 2011, 11:00 pm, edited 1 time in total.
 
User avatar
Hansi
Topic Author
Posts: 41
Joined: January 25th, 2010, 11:47 am

Using COM objects in R

March 10th, 2011, 11:34 am

Dunno might help with limiting the interface access but accessing it in R would be the same. I figured out that comGetObjectInfo was what I needed but it's a bit like wanting to shoot something with a sniper rifle and all you have is a tank. Following are lines 1-108 out of 3200! At that volume of info it's meaningless and I'll have to stick with the documentation instead:
 
User avatar
afoster
Posts: 5
Joined: July 14th, 2002, 3:00 am

Using COM objects in R

March 10th, 2011, 3:56 pm

How about using python win32com and rpy
 
User avatar
Hansi
Topic Author
Posts: 41
Joined: January 25th, 2010, 11:47 am

Using COM objects in R

March 10th, 2011, 4:08 pm

QuoteOriginally posted by: afosterHow about using python win32com and rpyIsn't rpy to access R from python? Even if I expose it to R it would still behave the same as the native COM unless I restrict the interface in much the same way a .NET wrapper would work. I don't want to have to bother since that will be beyond what I want to use this for and I'm 99% there anyway, I don't fancy starting a sub project to get that 1% might as well read the manual for once.
 
User avatar
QuantAsia
Posts: 0
Joined: March 10th, 2008, 1:38 am

Using COM objects in R

March 14th, 2011, 2:11 am

I found the RDCom packages from Omegahat very helpfull when dealing with COM objects in R:http://www.omegahat.org/RDCOMClient/
 
User avatar
Hansi
Topic Author
Posts: 41
Joined: January 25th, 2010, 11:47 am

Using COM objects in R

March 14th, 2011, 9:28 am

QuoteOriginally posted by: QuantAsiaI found the RDCom packages from Omegahat very helpfull when dealing with COM objects in R:http://www.omegahat.org/RDCOMClient/That hasn't been updated since 2003. It's since been forked and replaced by this: http://rcom.univie.ac.at/