Skip to content

Instantly share code, notes, and snippets.

@JoshuaTPierce
Last active June 30, 2017 02:13
Show Gist options
  • Save JoshuaTPierce/572835a785fb45a500f2157cc0f352ba to your computer and use it in GitHub Desktop.
Save JoshuaTPierce/572835a785fb45a500f2157cc0f352ba to your computer and use it in GitHub Desktop.
How to Install Correct Version of RGtk2 to Install Rattle:
#Install RGtk2 Locally (I left in in my downloads folder) from the following link:
#https://cran.r-project.org/bin/windows/contrib/3.3/RGtk2_2.20.31.zip
#Install RGtk2 into RStudio from the local file with the function arguments repos=NULL and type = "win.binary":
>install.packages("FILEPATH", repos = NULL, type = "win.binary")
#Install Rattle, including dependencies:
>install.packages("rattle", dep=TRUE)
#Close R Studio
#Re-open R Studio
#Call Rattle as you would:
>library(rattle)
[Rattle launch message]
>rattle()
Rattle should launch normally.
PLEASE NOTE:
R may prompt you to install Gtk+ in a small window after the first time you close out of R Studio and go back into R Studio to launch Rattle. You have no choice but to say (and this is okay).
It will throw an error message "Could not download Rgt+ dynamic package" (or something similar ). THIS IS OKAY.
R prompts us to do this automatically with the Rattle version taken from CRAN. This was the root of the actual issue: the current version of Rattle auto-installs an RGtk2 version that is buggy. By failing to install the dynamic Rgt+ package, R throws the error message "error in root..."requires" because of the failed package install. We will bypass this bad version of Rgt+ (the version without the dynamic library) in the next step because we installed a complete version of RGtk2 directly from a local file and not the CRAN version.
Close out of R Studio again, and re-open. This time, to launch Rattle, use the require() function on Rgtk2 to pre-load the CORRECT version of Rgtk2 we downloaded in the first step of the original post. This will bypass the incomplete Gtk+ package that R forces you to install. It should look like this:
> require(RGtk2)
Loading required package: RGtk2
> library(rattle)
Rattle: A free graphical interface for data mining with R.Version 4.1.0 Copyright (c) 2006-2015 Togaware Pty Ltd.Type 'rattle()' to shake, rattle, and roll your data.
> rattle()
This will launch a fully functional version of Rattle because we installed and then pre-loaded the correct RGtk2 package.
FINAL NOTE: To avoid error messages OR loading an incomplete version of Rattle (where the GUI pops up), get in the habit of calling >require(RGtk2) before the commands to launch Rattle.
@angelcake22
Copy link

angelcake22 commented Jun 30, 2017

Good day Josh,

After 2 long hours, I finally got it to work

Large Sigh of Relief

Thank you Josh!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment