15

I am new to data mining and R. Please provide how to proceed with following query.

I want to use the R-package Rattle for my data analysis on my MS Win 10- X64 system. I am following these instructions. I install the package using

    install.packages("rattle")

After selecting a CRAN mirror, it RGUI installs the package and gives following message:

   package ‘rattle’ successfully unpacked and MD5 sums checked
   The downloaded binary packages are in
   C:\Users\XXX\AppData\Local\Temp\RtmpYnMZM1\downloaded_packages

after that I run the code,

   library(rattle)

and RGui gives following response;

   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.

After this, I call the function 'rattle'.

   rattle()

and I get the following error:

   Error in method(obj, ...) : Invalid root element: 'requires'

I tried the same in the RStudio console as well. Also, I uninstalled RStudio and R X64, X386 and re-installed the same and tried again, but I fail to browse the reason for this error.

iehrlich
  • 3,572
  • 4
  • 34
  • 43
Maharshi24
  • 153
  • 1
  • 5
  • Can you make sure all package dependencies are met? – Roman Luštrik May 15 '17 at 08:04
  • Hi Roman, thanks for the response. please can you tell me how to do that. I tried, " devtools::check()" and it gives the error as "Error: Could not find package root." – Maharshi24 May 15 '17 at 08:10
  • Go through the package dependency list and make sure you are able to successfully load all packages. – Roman Luštrik May 15 '17 at 10:24
  • Hi Roman, I checked and downloaded all the package dependencies. After that too I am having the same error as earlier. – Maharshi24 May 15 '17 at 19:10
  • I even tried to install the old version of rattle (i.e. 4.0.5) but still having the same issue. – Maharshi24 May 15 '17 at 21:40
  • I have R 3.40. Are you suggesting that it would work with R 3.3 version and delete the 3.4?? – Maharshi24 May 19 '17 at 03:16
  • Hello All, updates: I get the following error while calling rattle now and the rattle GUI does not respond to any of the commands. code : 'rattle(useGtkBuilder = TRUE)' Message1: Error in `[[.GObject`(x, member) : Cannot find 'retval' for classes GdkPixbuf, GObject, RGtkObject Message 2: (rsession.exe:6716): Gtk-WARNING **: Could not find the icon 'gtk-file'. The 'hicolor' theme was not found either, perhaps you need to install it. You can get a copy from: http://icon-theme.freedesktop.org/releases' – Maharshi24 Jun 09 '17 at 23:28

2 Answers2

11

It seems RGtk2 related. grep in installed rattle directory shows this

$ grep 'requires' -r .
./etc/rattle.glade:  <!-- interface-requires gtk+ 2.16 -->
./etc/rattle.ui:  <!-- interface-requires gtk+ 3.0 -->
./etc/rattle.ui.160313:  <!-- interface-requires gtk+ 3.0 -->
./etc/rattle.ui.with_export_filechooser:  <!-- interface-requires gtk+ 3.0 -->
./etc/rattle_macosx.ui:  <requires lib="gtk+" version="2.16"/>
./NEWS:  * Note rattle.ui requires gtk > 2.16, not > 2.20. Otherwise fails to
./NEWS:  * Check for GtkBuilder handling of the 'requires' tag, and if not
./NEWS:    Gtk library installed does not recognise 'requires' and suggest a

Seems RGtk2 is causing the problem, emitting complains about the presence of the element named requires.

Solution I:

Downgrade RGtk2 from 2.20.33 to 2.20.31 worked for me.

Solution II:

Later I upgrade everything to the latest, including Windows GTK+2. Rattle stopped working. But rattle works again when invoked as below:

rattle( useGtkBuilder = TRUE)

Now I stick with the latter way.

On RGtk/GTK+ version:

I can't drag Rattle gui window around or resize it freely on Windows 7. This has been a constant pain. Higher version of RGtk2 or GTK2 doesn't seem to fix it (demo apps in GTK2 folder doesn't have this problem. But RGtk2 demo scripts do). So RGtk/Gtk+ version didn't make any difference for me.

PS: If you are running R-3.4.0 and trying to install the dev version from togaware.com, download http://rattle.togaware.com/bin/windows/contrib/3.3/rattle_5.0.10.zip ( which is actually built with R-3.4.0 thus doesn't work on 3.3.3 ) install it locally.

Ben
  • 1,133
  • 1
  • 15
  • 30
  • Solution II works for me. Thanks for your detailed explanation Ben. – Maharshi24 May 21 '17 at 23:14
  • Hello All, updates: I get the following error while calling rattle now and the rattle GUI does not respond to any of the commands. code : 'rattle(useGtkBuilder = TRUE)' Message: Error in `[[.GObject`(x, member) : Cannot find 'retval' for classes GdkPixbuf, GObject, RGtkObject (rsession.exe:6716): Gtk-WARNING **: Could not find the icon 'gtk-file'. The 'hicolor' theme was not found either, perhaps you need to install it. You can get a copy from: http://icon-theme.freedesktop.org/releases' – Maharshi24 Jun 09 '17 at 23:22
  • Sounds a GTK+ installation issue. Try the GTK demos to verify correct GTK installation (mine is in C:\Program Files\GTK+\bin\gtk-demo.exe) ? Try the RGtk demos to verify your Gtk setup (e.g. load RGtk2, try demo('rgtkplot'), run demo(package='RGtk2') to see all demos, ). – Ben Jun 10 '17 at 01:51
  • Solution 2 worked for me, after having upgraded everything. – Mike Goldweber Jun 12 '17 at 19:45
4

Use the script below for the install the dev version 5.0.18 as of 7/10. It'll save you from all the hassle

install.packages("rattle", repos="http://rattle.togaware.com")
Boris N.
  • 153
  • 5
  • Thanks! this saved my bacon, wasted an hour of my life trying to install and reinstall rattle with the dependencies running on anaconda without success, The rattle version on the conda repo is 4.1 which was causing issue with my R version, this solved the issue by installing Rattle version 5.2.5 :) – melaos Jan 21 '19 at 06:34