Error in installing packages 'RGtk2' and 'rattle' in R

20.2k Views Asked by At

I tried to install R packages 'rattle' but when I typed

install.packages('rattle')

it returns

Warning in install.packages :
dependency ‘RGtk2’ is not available

So I tried install 'RGtk2',

install.packages('RGtk2')

it returns

Warning in install.packages :
package ‘RGtk2’ is not available (for R version 3.2.3)

My computer is windows 8.1, R version 3.2.3 and I'm working on the R studio.

4

There are 4 best solutions below

0
On BEST ANSWER

One possible solution as mentioned is to install an older version of RGtk2. For Windows this might be:

install.packages("https://cran.r-project.org/bin/windows/contrib/3.3/RGtk2_2.20.31.zip", repos=NULL)

Further suggestions can be found at https://rattle.togaware.com/rattle-install-troubleshooting.html

0
On

Listed below are the known compatible versions which will definitely work:

  1. Try to downgrade your R version to 3.3.2.
  2. Download RGtk2 version with 2.20.33 and manually install it.
  3. Install rattle version as 4.1
0
On

For linux users, this worked for me :

install.packages("https://cran.r-project.org/src/contrib/Archive/RGtk2/RGtk2_2.20.30.tar.gz", repos=NULL)

RGtk2 installed, you can run install.packages("rattle")

You may also need to install libgtk2.0-dev and libxml2-dev before installing RGtk2 !

Conf : Ubuntu 16.10 (yakkety) and R version 3.3.1

0
On

I use macOS and used the following instructions to sought this out.

Step 1:

brew install gtk+
brew install --with-x11 cairo

Step 2:

install.packages("rattle")

There would be loads of red lines on the console, while you're installing rattle, but it's OK. It will work out.