Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using COM in R language

Tags:

r

com

ole

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?

like image 906
User1 Avatar asked Aug 25 '09 04:08

User1


People also ask

Is R used in industry?

R is one of the standard tools that is being used in e-commerce. Since these internet-based companies have to deal with various forms of data, structured and unstructured, as well as from varying data sources like spreadsheets and databases (SQL & NoSQL), R proves to be an effective choice for these industries.

What is the use of R language?

R offers a wide variety of statistics-related libraries and provides a favorable environment for statistical computing and design. In addition, the R programming language gets used by many quantitative analysts as a programming tool since it's useful for data importing and cleaning.

What does \r represent?

\r is a carriage return which often means that the cursor should move to the leftmost column, while \n is a line feed which moves the cursor to the next line.

Is R easier than Python?

R can be difficult for beginners to learn due to its non-standardized code. Python is usually easier for most learners and has a smoother linear curve. In addition, Python requires less coding time since it's easier to maintain and has a syntax similar to the English language.


1 Answers

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.

like image 65
Matt Parker Avatar answered Sep 20 '22 03:09

Matt Parker