Your own time, your own pace

Main menu

Post navigation

Installing Rattle and R

The halo around R continues to grow and grow, more and more organizations are now beginning to explore building capabilities in R programming as it can potentially deliver costs savings. More on the comparison of R and SAS in our earlier blog entry.

In this post we will take you through installation of R and Rattle on a Windows 7 machine. Here is a youtube video showing the capabilities of R on a small credit scoring dataset.

Download R from the website. The link provides for Windows installation, the setup file for both 32 bit and 64 bit systems is the same, so you need not worry.

The setup file is an executable, simply run it and follow the instructions, it should install the basic R software on your system.

There should be an icon created on your desktop, in 64 bit systems two icons get created (one for normal 32 bit, the other for 64 bit). If you have a 64 bit system, double click on the Rx64 2.XX icon, where XX is the version number)

The following window should open uptype in the following commands one after the other, press enter after each statement install.packages(“RGtk2”) & install.packages(“rattle”). After the first command, a window will open up asking for a CRAN mirror to be selected as below, You can select any CRAN mirror to download the packages from (to be safe, select any US or western Europe mirror to ensure latest versions)

Run the following commands now » library(rattle) followed by rattle()

This is where most errors regarding rattle installation pop up, in a lot of cases R will thrown an error such as GTK not found or error with GTK+ and it will offer to download GTK for you. But even that option after download will not work. Fear not, follow the instructions below to resolve, if your Rattle window launches, congratulations, its working

On the page scroll down to GTK+ packages and select GTK+ Version 2.24.8 (32 bit Runtime); GTK+ Version 2.22.1 (64 bit- Binaries)

Copy it to the C drive root and extract the ZIP files as they are. For e.g. I create a folder C:\gtk+_2.22.1-1_win64

Now Right click on My Computer and then click on Properties (Alternatively you can go via Control Panel >System & Security>System), a new window will open up, on the left hand side click on “Advanced system settings”

A new window as below will open up

Click on Environment Variables near the bottom, a new window will again pop up, within the system variables selection, scroll down to path and click on edit.

An “Edit System Variable” window will open up with variable name “Path”, within variable values you will see a number of Folder paths separated by a semi colon.

Within the variable values go the beginning and add a path to the GTK folder we had extracted to the Bin folder, for e.g. C:\gtk+_2.22.1-1_win64\bin followed by a semi colon. (Note: make sure your path actually exists in the folder you have extracted into, i.e. the bin folder)

Close all and restart the R software

Type in library(rattle), press enter followed by rattle()

The rattle window should now open up, you are now ready to shake, rattle and roll your data. Install all packages which Rattle prompts you to, it will be done automatically after you press ok. Check out our Rattle demonstration post for a flavor of what Rattle can do.

Do let us know if the post was helpful in solving your Rattle installation issues, especially the pesky GTK/RGTK2 error. Feel free to comment even if you still face installation issues, we will try and solve them!

Only a couple of R packages are dependencies for
Rattle
. Most are suggestions, but without
them functionality is quite limited. At a minimum it is useful to ensure you have the
RGtk2
package
installed. Others that you might like to install include:
ada
,
arules
,
doBy
,
ellipse
,
fBasics
,
fpc
,
gplots
,
Hmisc
,
kernlab
,
mice
,
party
,
playwith
,
pmml
,
randomForest
,
reshape
,
rggobi
,
RGtk2
,
ROCR
,
RODBC
, and
rpart
.
The packages will usually be installed with the following command:
> install.packages(“rattle”, dependencies=c(“Depends”, “Suggests”))
after that type
>library(rattle)
>rattle()
hope this helps

I followed above steps but still not able to get started with rattle. I updated the path also but R shows same error message. It keeps on downloading and fails to extract files. Permission denied error. Exdir msg. How do i resolve that. Please advise.

Error in configureGUI() : could not find function “paste0”
In addition: Warning messages:
1: package ‘RGtk2’ was built under R version 2.14.2
2: package ‘colorspace’ was built under R version 2.14.2
Cannot get rattle to do anything

I have installed R-2.14.2, rattle_2.6.17, RGtk2_2.20.21 and gtk+-bundle_2.24.8-20111122_win32 to run rattle on my wndow (XP). While starting rattle I got following message
“the procedure entry point deflatesetheader could not be located in the dynamic link library zlib1.dll”