在R语言中使用COM
我正在尝试让 R 的 rcom 包正常工作。它似乎已经安装好:
> 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
然后我尝试运行一些东西:
>comCreateObject("Excel.Application"); Error: could not find function "comCreateObject"
我缺少什么,manual 告诉我 comCreateObject 是合适的命令。不过,该手册的版本有些旧。还有其他人有任何见解吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我可以在这里看到一些潜在的问题 - rcom 有一个奇怪的安装。
您是否加载了该软件包 - 即安装后运行
library(rcom)
?我知道,我知道 - 但我总是忘记那一步,它肯定会给你“找不到函数”错误。您是否运行了
installstatconnDCOM()
命令?我几乎没有注意到它告诉我要这样做。I can see a couple of potential problems here - rcom has a weird installation.
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.Did you run the
installstatconnDCOM()
command? I almost didn't notice it telling me to do this.