EViews 7, 8, and now 9 all depend on middleware software written by Thomas Baier called statconnDCOM in order to communicate with R. This middleware provides a COM Automation interface to R so that EViews can put and get R data, and also send R commands to execute. statconnDCOM must be properly installed (along with R) before EViews can successfully do these actions.
statconnDCOM
statconnDCOM (for commercial use) is provided for a fee. Please go to their website for sales information:
http://www.statconn.com/products.html
(Their purchased version allows you to use both 32-bit and 64-bit R)
As of today (April 13, 2015), there is also a free non-commercial version available for use. You can find this version here:
http://rcom.univie.ac.at/download.html
(currently, this version is named statconnDCOM Home & Student)
For our non-commercial users, I will describe how to setup statconnDCOM Home & Student properly. (Purchased users of statconnDCOM can follow the same instructions but without the limitations of installing "rscproxy" into a library folder and without the restriction of 32-bit R only.)
Using 32-bit R 3.0.3
I believe the Home & Student version only allows access to 32-bit R. You must have 32-bit R installed. Note: You can use 32-bit statconnDCOM with 64-bit EViews so you do not necessarily need 32-bit EViews installed as well. My testing of the statconnDCOM3.6-0B2_Noncommercial version found some problems with the latest version of R 3.1.X (April - October 2014). If you have statconnDCOM3.6-0B2, I suggest you use 32-bit R 3.0.3 (March 2014) instead:
http://cran.stat.ucla.edu/bin/windows/base/old/
rscproxy
statconnDCOM itself requires that the "rscproxy" package be installed in R. The Home & Student version requires that "rscproxy" be installed in the R library folder, not a user-folder. To insure proper installation of this package, you must run 32-bit R with admin rights before attempting to install the "rscproxy" package. In R, go to the Packages menu->Install Packages... and pick the "rscproxy" package from the list. The package should install directly to the library folder without asking to save in the user directory. If this question is asked, please restart R with admin rights and try the install again. To verify proper installation, type in the command:
Code: Select all
require("rscproxy")
and you should see the proper response from R:
Code: Select all
Loading required package: rscproxy
statconnDCOM License File
Next, install statconnDCOM from the statconnDCOM3.6-0B2_Noncommercial.exe installer. This will install various help files and sample programs. Once installed, you will need to download and copy the "Testing.lic" file (also available from http://rcom.univie.ac.at/download.html) and place it into the statconnDCOM folder (usually found at: C:\Program Files (x86)\statconn\DCOM).
Testing statconnDCOM with R
statconnDCOM provides a sample test program (named "Simple 01 - Basic Test") to make sure all functionality works properly between statconnDCOM and R. Look for the "Server 01 - Basic Test" program under the Windows Start button / All Programs / statconn / DCOM (or you can run the EXE directly from C:\Program Files (x86)\statconn\DCOM\samples\Simple\simple.exe). Once running, click the R32 button to begin the test for 32-bit R. You should see the statconnDCOM splash screen appear along with debug output in the large textbox below the R32 button. If any message dialogs appear with an error, then a problem exists between statconnDCOM and R. Debugging these problems may require you to do some research into the specific problem. The following (older) PDF may provide some insight into what can cause certain errors:
https://www.unt.edu/rss/class/splus/Usi ... server.pdf
My testing was done with 32-bit R 3.0.3, rscproxy 2.0-5, and statconnDCOM3.6-0B2 on a Windows 7 64-bit machine. With these versions, the "Simple 01 - Basic Test" program ran without any issues.
If you wish to use statconnDCOM with newer versions of R, simply run the same test program to verify that all functionality is still working. If you run into any issues, you may need to downgrade your version of R in order to fix them.
Using R with EViews
Once you've confirmed statconnDCOM is installed properly and communicating with R without issue, you can use it in EViews with the XOPEN, XPUT, XGET, and XRUN commands.
Code: Select all
XOPEN(r)
Please refer to our documentation for more details on how to use the various 'X' commands.
Steve