R and Calc

From Apache OpenOffice Wiki
Revision as of 06:25, 19 March 2008 by Wojciech (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
This page is meant as a general overview and installation guide for the software. Please see R and Calc Documentation for more information on functions, scripting, and general usage. Also feel free to submit bug reports in the R and Calc: Bugs and Feature Requests page, and provide feedback at the extension page.

"R and Calc" is an OpenOffice.org (OO.o) Calc add-on that allows you to use R methods and functions. The software is currently in early development, though a basic working version does exist, and is available for download.

We welcome any and all comments and name suggestions. Please send them to Wojciech Gryc.

For those who come here often, here is the latest version:


You need the following software to run this add-on. While older versions may suffice, they have not been tested yet.

  • OpenOffice.org 2.1
  • Java 5.0
  • RServe 0.4.7


The current version is a prototype and implements only one tool: RDUMP. This method is accessed through the actual Calc menu, and allows you to see the R object structure for various method calls.

To use the add-on, you need to install R and Rserve. Instructions for installing R can be found at http://www.r-project.org/ Once installed, run R and type the following to install Rserve. Click "enter" at the end of each bullet point:

  • install.packages("Rserve")

Rserve needs to be running to work, and can be launched with the following commands... Note that you only need to do this when you want to use the R Add-on for Calc.

  • library(Rserve)
  • Rserve()

Now that you have the prerequisites installed, download the package RAddon.uno.pkg (linked above). Unzip the file, and let's call the directory you unzipped it in <RA_DIR>. Now let <OO_HOME> be your OpenOffice.org installation directory. Open the command prompt or terminal window and go to <OO_HOME>/program/ and type:

  • unopkg add <RA_DIR>/RAddon.uno.pkg

If this is not your first time installing the add-in, you need to check if a previous version is also on the system. If it is, then you will not be able to install the new version. To do this, go to <OO HOME>/program and type:

  • unopkg list

This will show you the list of packages already installed, and you should be able to check if the add-is is there. Remember to look for "RAddon.uno.pkg". You can also skip this step and try to uninstall RAddon.uno.pkg regardless -- this will not harm your OpenOffice.org installation in any way, even if RAddon.uno.pkg is abset. To do this, type:

  • unopkg remove RAddon.uno.pkg

Finally, some operating systems require that you restart your OpenOffice.org installation (if you're not sure, restart your computer) to be able to see the cell functions that come with this package.


Using the add-on is very simple at this stage. To see the tool at work, open Calc. In the menus, go to R Add-on > Rdump(). A new dialog window will pop up. Type in an R script -- here are some examples:

  • rnorm(10)
  • cor.test(c(1,2,3,4), c(1,2,2,3))

Then click "Run". A new sheet should appear. Close the dialog with "Close" and check the new sheet -- you should see various pieces of information on the sheet.


So far, the software has been tested on the following.

Version 0.1.7

  • 64-bit Gentoo Linux running JDK (64-bit version), OpenOffice 2.2.1, and R 2.4.1

Version 0.1.6

  • Ubuntu Feisty Fawn on Java 1.6.0

Version 0.1.5

  • Fedora Core 7 running native Java
  • Ubuntu Edgy Eft running SDK 1.5.0_08 and OpenOffice 2.1.
  • Windows XP SP2 running running JDK 1.6.0_02 and OpenOffice 2.2.

Version 0.1.0

  • Fedora Core 6 running JDK 1.6.0_01 and OpenOffice 2.2.
  • Ubuntu Edgy Eft running SDK 1.5.0_08 and OpenOffice 2.1.
  • Windows XP running running JDK 1.6.0_01 and OpenOffice 2.2.


This add-on is the result of a Google Summer of Code 2007 project. It was initially created by Wojciech Gryc. For information pertaining to the development of this add-on, see Wojciech's Blog.

Older Versions

Personal tools