Search code examples
rrstudiorattle

rattle installation error: Invalid root element:


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.


Solution

  • 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.