Using R Inside Microsoft Excel
If you’re familiar with Microsoft Excel, or if you work with a lot of data files in Excel format, you might want to run R directly from inside Excel. The RExcel software lets you do just that (on Microsoft Windows systems). You can find information about this software at http://rcom.univie.ac.at/. This site also includes a single installer that will install R plus all the other software you need to use RExcel.
If you already have R installed, you can install RExcel as a package from CRAN. The following set of commands will download RExcel, configure the RCOM server, install RDCOM, and launch the RExcel installer:
> install.packages("RExcelInstaller", "rcom", "rsproxy")
> # configure rcom
> library(rcom)
> comRegisterRegistry()
> library(RExcelInstaller)
> # excecute the following command in R to start the installer for RDCOM
> installstatconnDCOM()
> # excecute the following command in R to start the installer for REXCEL
> installRExcel()Follow the prompts within the installer to install RExcel.
After you have installed RExcel, you will be able to access RExcel from a menu item. If you are using Excel 2007, you will need to select the “Add-Ins” ribbon to find this menu as shown in Figure 2-4. To use RExcel, first select the R Start menu item. As a simple test, try doing the following:
Enter a set of numeric values into a column in Excel (for example, B1:B5).
Select the values you entered.
On the RExcel menu, go to the item “Put R Var” > “Array.”
A dialog ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access