RStudio and Rattle Installation Assistance

We are going to use Rattle for the first few weeks of the course and then switch to RStudio. There are two ways to install Rattle and RStudio. The first way is installing RStudio and then Rattle inside of the RStudio platform. The second way is installing R and Rattle separately and then installing RStudio later on.

In this document, we describe the procedures for doing it with Rstudio first. To do it without Rstudio, just type the commands directly into the R interface. See the Rattle book, DMRR, for more details.


(1) R Studio Installation Guide

Find the right version of an installer for RStudio for your platform here and download it. Once it is downloaded, run the installer and the installation process will start shortly.

For more information about RStudio, please visit https://www.rstudio.com/products/rstudio/download/
The suggested video for the first week also shows how to install Rattle.

(2) Rattle Installation Guide 

  • Open RStudio and enter the following command at the prompt (the lower left-hand corner of the screenshot below).

rattle package command in RStudio

  • install.packages(“rattle”)

Enter the following two commands at the R prompt. This loads the Rattle package into the library and then starts up Rattle.

  • library(rattle)

To run the Rattle GUI on RStudio, type the following command:

  • rattle()

If a separate Rattle GUI pops up, you are set to go!

This should be enough on Windows systems.

(3) How to solve the dependency problems (Rattle needs RGtk2, XML, and CarioDevice)

TL;DR

Rattle will install other packages as needed but we can force the install of all other packages Rattle uses in one go if we so wish, using:

  • install.packages(“rattle”, dep=c(“Suggests”))

A longer explanation

If the RGtk2 package has yet to be installed, there will be an error popup indicating that libatk-1.0-0.dll is missing from your computer. Click on the OK and then you will be asked if you would like to install GTK+. Click OK to do so. This then downloads and installs the appropriate GTK+ libraries for your computer. After this has finished,  exit from R and restart it, so that it can find the newly installed libraries.

When running Rattle a number of other packages will be downloaded and installed as needed, with Rattle asking for the user’s permission before doing so. They only need to be downloaded just the once.

The installation has been tested [140720] to work on Microsoft Windows, 32bit and 64bit, XP, Vista and 7 with R 3.1.1, Rattle 3.1.0 and RGtk2 2.20.31.

Similarly for XML and CarioDevice packages, click on the OK when you are asked if you would like to install the packages.

(4) Optional for Windows

To use the Microsoft Windows theme engine, and thus have Rattle look like all other Windows applications (in terms of colour and style), create a file with the name gtkrc to contain the following line. Make sure the file name does not have any filename extension (i.e., no .txt or anything else with a dot). The file needs to be located in the GTK+ installation folder. This might be, for example, C:/Users/username/R/win-library/2.15/RGtk2/gtk/i386/etc/gtk-2.0/.

  • gtk-theme-name = “MS-Windows”

(5) Installing Rattle on a Mac

Former student Yicong Li figured out some very useful information. In the past, many Mac owners have had trouble installing Rattle. Here is what she learned, after considerable research. Also: It is worth repeating the regular Rattle install several times. The basic problem is that some additional libraries must be installed in order for Rattle to run. These libraries seem to install only gradually.

These instructions are from April 2017. They may need updating. Please give comments on this message, or mail them to the TA, Feiyang.Chen@rady.ucsd.edu,  if you run into additional installation problems. Also, respond if you have suggestions that might be helpful.

===============
Hi Roger,
Just want to update with you that I think I found a solution for installing rattle packages.
Problem: run >library(rattle)  and get >error on install GTK+
Solution: Second answer from this site: http://stackoverflow.com/questions/36042749/error-installing-rattle-package-in-mac
Note: No need re-install R or Rstudio, just install XQuartz and GTK+ from links provided.
Then run >install.packages(“rattle”, repos=”http://rattle.togaware.com“, type=”source”)
>library(rattle)
>rattle()
It works on my Mac now. Hope it can help others that having the same problem.
Here is what I did on another machine and it worked.
Install XQuartz  from this link.

  1. Install GTK+ from this link.

Run:
>install.packages(“rattle”, dependencies = T)
This will work.

Advertisements

One thought on “RStudio and Rattle Installation Assistance”

  1. Hello,
    I’m having a problem to get RGtk2 installed and libatk-1.0-0.dll installed. Here is where I got stuck. Any advice?

    > library(“RGtk2”);
    Error in inDL(x, as.logical(local), as.logical(now), …) :
    unable to load shared object ‘C:/Program Files/R/R-3.5.1/library/RGtk2/libs/x64/RGtk2.dll’:
    LoadLibrary failure: The specified module could not be found.

    trying URL ‘http://ftp.gnome.org/pub/gnome/binaries/win64/gtk+/2.22/gtk+-bundle_2.22.1-20101229_win64.zip’
    Content type ‘application/zip’ length 25830230 bytes (24.6 MB)
    downloaded 24.6 MB

    Learn more about GTK+ at http://www.gtk.org
    If the package still does not load, please ensure that GTK+ is installed and that it is on your PATH environment variable
    IN ANY CASE, RESTART R BEFORE TRYING TO LOAD THE PACKAGE AGAIN
    Warning messages:
    1: Failed to load RGtk2 dynamic library, attempting to install it.
    2: In dir.create(config_path, recursive = TRUE) :
    ‘C:\Program Files\R\R-3.5.1\library\RGtk2\gtk\x64\etc\gtk-2.0’ already exists

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s