The RExcel Package

For additional information on the RExcel package, see the statconn wiki (useful), statconn (not so useful), R packages (search for the word excel), wikipedia (brief article), and the book R Through Excel: A Spreadsheet Interface for Statistics, Data Analysis, and Graphics (amazon link). See R Through Excel for instructions on installing the R Through Excel Workbooks.

How to Install via the RAndFriendsSetup.exe File

The following instructions are for Windows XP and Vista users. They haven't been tried for Windows 7, but may work. You will need to have installed Microsoft Excel 2002, aka Excel XP, Excel 2003, or Excel 2007. You do not need to have installed R, and this may work better if you haven't. The RAndFriendsSetup file installs a new version of R. If you have already installed an RExcel package version older than 3.0.0, you will need to uninstall it prior to installing the new version. RExcel versions 3.0.0 and later do not need to be uninstalled first.

  1. Go to statconn.
  2. Click on "Download".
  3. Click on the link for RAndFriendsSetup to download the file. The file name will contain version information, e.g. RAndFriendsSetup2101V3.0-18-1.exe.
  4. Double click the downloaded file to run it. Vista users need to right click and select run as an administrator.
  5. You may get an unable to verify publisher warning, which you can click through.
  6. Click through the standard install stuff. You may choose whether or not you want to install Ggobi/RGgobi, a 3D graphing package, and Notepad++/NppToR, a text editor for R.
  7. You will need an active internet connection to complete the install. In particular, it will download statconnDCOM.
  8. After statconnDCOM is downloaded, it will automatically start the install. You will need to click through another set of standard install stuff.
  9. It will then start the install for RExcel. Click through another set of standard install stuff for RExcel.
  10. Watch out for a hidden pop up message that you have to click ok on to complete the install. It gets hidden under the Setup windows. Ironically, the message is a warning that another pop up message that you have to click ok on, may be hidden under another window. If it looks like the install has frozen, search for these pop-ups by minimizing and maximizing windows.
  11. It will then start the install for RAndExcelWorkbooks Setup. Click through another set of standard install stuff.
  12. If you selected Ggobi/RGgobi and Notepad++/NppToR, they install next. Click through standard install stuff for each. You may want to read the options presented for these packages more carefully and select based on your personal preferences.

Now test your install.
   1. Open up Excel.
   2. Excel 2007: Click on the Add-Ins tab at the top of the Excel window.
        Home | Insert | Page Layout | Formulas | Data | Review | View | Add-Ins.
        Excel 2003: Click on the RExcel menu near the top of the Excel window.
        File | Edit | View | Insert | Format | Tools | Data | Window | RExcel | Help.
        You may need to activate the RExcel menu via Tools -> Add-Ins.
   3. Within the Add-Ins tab, there should be an RExcel drop down menu. Click on that and select "Start R". The R Console will open in a separate window.
   4. Create some data in Excel, e.g.
X Y
1 2
2 4
3 6

   5. Highlight the data, highlighting just the 4x2 box of cells with the variable names and data in it. Don't highlight whole columns or rows.
   6. Select "Put R Var" -> "Dataframe". Name the dataframe something like "d" without the quotes.
   7. Click on the R Console and enter then name of the dataset, e.g. "d" without the quotes, and hit enter. You should see your dataset returned.
   8. If your dataset was returned, you've shown Excel and R are communicating with each other. Test done.

If Excel is installed, R installed correctly, but the RExcel menus don't appear in Excel, then
RExcel may not have installed correctly. Try the following.
  1. Open R. Vista users need to right click on the R icon and select "run as administrator".
  2. At the R prompt, run the commands:
    library(RExcelInstaller)
    That's "Excel" with a lower case L and "Installer" with a capital i.
    installRExcel()

How to Install via the R command line

The following instructions are for XP and Vista users, and may work for Windows 7 users.

  1. Install R (see http://cran.r-project.org/ for details). If you are running an old version of R, now may be a good time to update.
  2. Open R. Vista users need to right click on the R icon and select "run as administrator".
  3. At the R prompt, run the commands:
    install.packages( c( "RExcelInstaller", "RcmdrPlugin.HH" ), dependencies=TRUE )
    library(RExcelInstaller)
    installRExcel()
    Make sure to read the pop up messages carefully.
    library(RcmdrPlugin.HH)

See also statconn wiki's how to install.

Topic revision: r5 - 11 Jan 2010, RobertGreevy
 

This site is powered by FoswikiCopyright © 2013-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Vanderbilt Biostatistics Wiki? Send feedback