7

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.

Edward M.
  • 221
  • 1
  • 5
  • 11
  • 1
    One option is to install `install.packages('versions')` if not available, then get the tar.gz (on linux) or binary zip on windows. install it, and then you can install a suitable version `install.versions(rattle, )` – akrun May 18 '17 at 11:14
  • @akrun Thanks for comment. I guess this is not a problem of R version. It seems that this kind of problem occurs in other versions of R. – Edward M. May 18 '17 at 11:20
  • 3
    It is a version issue. RGtk2 requires an R version >=3.4. You need ti find an earlier version of RGtk2 that allows R 3.2.3 – Dason May 18 '17 at 11:40
  • @Dason Yes. Thanks! I updated R and made it! – Edward M. May 18 '17 at 13:28

4 Answers4

11

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

Graham Williams
  • 488
  • 2
  • 8
3

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

Ahmed Laatabi
  • 849
  • 1
  • 7
  • 21
1

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
Greenonline
  • 1,231
  • 6
  • 19
  • 25
1

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.

qed
  • 128
  • 7