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.

  1. 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.
  2. The setup file is an executable, simply run it and follow the instructions, it should install the basic R software on your system.
  3. 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)
  4. The following window should open upR software interfacetype 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)
  5. Run the following commands now » library(rattle) followed by rattle()
  6. 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
  7. For those with GTK problems follow the below bullet point steps
  • 32 Bit systems open this link, 64 bit systems open this link.
  • 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!

LearnAnalytics Team.


15 thoughts on “Installing Rattle and R

  1. I have a couple of questions regarding R and its kinda urgent.
    1. I am not able to use boost and SVM in Rattle, after loading the data, both of these options are not active.

    2. While building the model, how do I define the 5 fold cross validation option. I have split the data and decided the important variables using caret in R so I already load the training set to build the model and then score both the training and test set separately. Is that correct?

  2. Only a couple of R packages are dependencies for
    . Most are suggestions, but without
    them functionality is quite limited. At a minimum it is useful to ensure you have the
    installed. Others that you might like to install include:
    , and
    The packages will usually be installed with the following command:
    > install.packages(“rattle”, dependencies=c(“Depends”, “Suggests”))
    after that type
    hope this helps

  3. It worked for me to install the GTK+ packages into R by the following command line. And then I can install the “rattle” packages successfully. Try it.

    install.packages(“”, repos=NULL)

    • Hi,

      I still get this error when I typed “library(rattle)”

      unable to load shared object ‘C:/Users/herma/Documents/R/win-library/3.2/RGtk2/libs/x64/RGtk2.dll’:

      What do I do?
      Is this blog still active?


  4. 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.

  5. I am using R 2.14.1 and get the following:

    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

  6. i am using win7 OS i installed rattle. i am able to see the rattle GUI but when i give a csv file and click execte its not working it npt displying any error… how to run rattle.

  7. 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”

    may I know the problem as I am totally new to R.

Leave a Reply

Your email address will not be published.