Paper

Submitted by: Submitted by

Views: 309

Words: 3403

Pages: 14

Category: Other Topics

Date Submitted: 11/30/2011 12:49 PM

Report This Essay

R: RExcel - Using R from within Excel

file:///C:/Program%20Files/R/R-2.4.1/(D)COM%20Server/doc/RExcel.html

RExcel - Using R from within Excel Overview

The Excel addin RExcel.xla allows to use R from within Excel. The package additionally contains some Excel workbooks demonstrating different techniques for using R in Excel. There are two types of servers, forground and background. The background server ist totally hidden from the user, all interaction with R has to be done in Excel. The foreground server allows direct access to the R GUI command line while working in Excel. The backgound server is installed with the R(D)COM server, the background server depends on the {R}-package rcom, which has to be installed >from CRAN.

Usage

There are at least three different ways of using R from within Excel Scratchpad mode Writing R Code directly in an Excel worksheet and transferring scalar, vector, and matrix variables between R and Excel Macro mode Writing macros using VBA and the macros supplied by RExcel.xla , attaching the macros to menu items or toolbar items Worksheet functions R can be called directly in functions in worksheet cells

Scratchpad Mode

The RExcel menu contains the following items R Start Initiates a connection to R If necessary starts an R process to be accessed >from Excel For the details of executing code at startup see section Startup Close R When this process is running, R Start changes to Close R Run Code Selecting a range (only one column wide) in Excel containing valid R code and then choosing this menu item executes the selected code Get Gets the value of an R variable into the active Excel cell or range Possible values are scalars and matrices of numbers or strings, or dataframes. Put Puts the values of the selected Excel range into an R variable. Possible values are scalars and matrices of numbers or strings, or dataframes. If a dataframe is to be put, the first row of the Excel range must contain the variable names for the...