[SOLVED] Installing rattle on R 3.1 and Mac OS X 10.9 (Mavericks)

[Total: 5    Average: 4.8/5]

Rattle is a really nice GUI environment for data mining based on R. If you don’t know it yet, it is worth taking a look here.

Or since you are reading this, maybe you are already a user but are facing some problems to install it with the latest versions of R on your Mac using OS X 10.9. If this is the case, you came to the right place and here is how to solve it.

Explanation (jump below for the step-by-step solution)

The problem with installing Rattle is linked to its dependency on the the RGtk2 package. This package will miserably fail to install under R 3.1 on Mac OS X 10.9 with a misleading set of messages like those shown below, even if installed from “source”.

After some investigation and debugging, it turns out this is due to multiple problems that need to be solved one by one. The particularly misleading part is the dependency of the installer from pkg-config. This can be easily solved by installing the pkg-config utility.

Once pkg-config is available, the RGtk2 installer requires the presence of the gtk+-2.0.pc file (see the configuration shell script). This file was normally part of a gtk+ installation, but this is no longer the case, at least using the available Gtk+ binary installers for Mac. This can be solved by installing Gtk+ from source with the help of homebrew or port. I used port.

If you are of the curious kind, here is the content of my gtk+-2.0.pc file:

With Gtk+ properly installed, the gtk+2.0.pc file is available to use by pkg-config (called within the RGtk2 installer), but here is the trick. In order for pkg-config to be able to find the gtk+2.0.pc we need to add an environment variable PKG_CONFIG_PATH pointing to the folder where the file is located. In the case of my system (after the Gtk+ installation, see below), the gtk+2.0.pc file it is located in:

Once pkg-config knows where to find pkg+2.0.pc file,  everything works fine.

By the way, a successful installation of RGtk2 can be accomplished also directly in RStudio by setting the environment variables properly. Jump to step 8) if you already did all the previous steps and just need to complete this one within RStudio.

Many of the steps below are similar to those mentioned here. The solutions proposed elsewhere didn’t fully work for me because they were missing the point that pkg-config cannot find the gtk+2.0.pc file.

Without further due, here is the complete procedure.

Step-by-step solution

(1) Check under Applications –> Utilities –> X11 if you have X11 installed. Normally it is not installed on this version of Mac OS X. Once you check, you will be asked whether you want to install XQuartz. Go ahead and do so. Now you should see XQuartz in your Utilities.

(2) Install the latest version of port, which will help with the rest of the steps. You can get it here: https://www.macports.org/

(3) Install the XCode command line tools from Apple or a complete version of XCode. You will need a (free) developer AppleID. These are necessary to build Gtk+ from source (see below).

(4) Open a terminal window and issue the following commands (> is the command prompt, don’t type it!):

Make sure you leave it open because we will need it again unless you want to do this in RStudio (see below).

(5) Download RGtk2 source and cairoDevice source from CRAN. Here: http://cran.r-project.org/web/packages/RGtk2 and here http://cran.r-project.org/web/packages/cairoDevice and place them in your Downloads folder.

(6) At the same command prompt as above, issue the following command:

where xx.yy.z are the respective version numbers of the RGtk2 and cairoDevice packages you downloaded.

(7) You are done! Provided that pkg_config can be found (see the PATH above) and that the gtk+2.0.pc file can be located (see PKG_CONFIG_PATH above) RGtk2 should install properly (with just some warnings). At this point you can install and launch rattle without any problems.

Now if you are using RStudio and want to install RGtk2 from source directly in it, after step 4) above do the following:

(8) In RStudio, we first need to set the environment variables in a similar way we did above. This is because RStudio uses an own version of the environment when issuing system commands during a package install. Type the following in the R console (> is the command prompt, don’t type it!):

(9) Install RGtk2 from source with the following command:

At this point the installation should conclude properly with just some warnings. If this is the case, at the end you should see something like this (for RGtk2 and similar for cairoDevice):

Now you can happily run rattle on your R 3.1 and Max OS X 10.9! Happy data analysis.

Screen Shot 2014-08-29 at 14.34.06

If this solution works for you too, please let me know by leaving a comment below. Tnx!

Till next time,
Marco.

Note (9 Dec 2014): The original article had an imprecision on the name of the environment variable pointing to the location of the gtk+2.0.pc file. The correct name is PKG_CONFIG_PATH and it has been corrected in the text above. Many thanks to John Honan and Alan Chao for having pointed the mistake out to me and apologies to all the readers who still encountered issues due to that imprecision.

You may also like

60 Comments

  1. Hi Marco ,

    Thanks for this but unfortunately it does work for me! R still can’t find the pkg-config.

    Best

    1. Hi Barry,
      we need to do a bit of trouble-shooting here. First things first.
      Did you install pkgconfig and add its /bin folder to the PATH with this command (please note that your pkg-config binary could actually be in a different location, then you have to find out where it is and use the right path to it):
      > export PATH=/opt/pkgconfig/bin:$PATH
      Please confirm it by opening a terminal and typing
      > pkg-config
      with no arguments. If it works, you should see a message like:
      Must specify package names on the command line
      If it doesn’t work you should get an error.

  2. My first try failed, probably i thought the command line tools were already installed. In step (4) i realized that this was not the case. I installed the command line tools and proceed. And it did not work: when i tried to install the RGtk2, the computer said no: checking for GTK … no.

    For my second try i followed the step-by-step solution very strict. In step (6) i even typed the full path to the RGtk2 and cairoDevice files. It worked.

    Thanks! You saved the day.

  3. Thanks for the solution, it worked fine in Mavericks and R 3.1.1, just follow all indications step by step!!!
    I have been 1 year without being capable of installing this tool in my mac (previously I had snow leopard), but now it finally works.

    I just want to comment that the rattle authors should have come up with a much easier way to install such tool in mac, it does not make sense to: 1) have to search the web for a solution 2) have to follow all these steps, some require time and restarts…

    Regards,
    Paulo Cortez

    1. Hi Paulo,
      glad it worked fine for you and that you are able to use Rattle again after such a long time.
      On a side note, I believe the authors of Rattle were unaware of the changes in Mavericks which affected the dependencies from Gtk+. On the other hand, I agree that the installation process as it is now is pretty cumbersome. I hope they find a way to clean it up and make it work out of the box.
      Ciao,
      Marco.

  4. Hi, Marco,
    Thanks for your detailed step by step instructions. They worked perfectly and at the first go! (incl. RStudio)
    Much appreciated!
    Brgds,
    rg

    1. Great, thanks for letting me know Ryszard! I have forwarded the link to the article the folks at Togaware (the makers of Rattle) so they can point out other users to this work-around.
      Cheers,
      Marco.

  5. Marco – thank you this is the best I have found on the internet. Unfortunately, I am absolutely terrible when it comes to installation/configuration. I am still running into issues.

    I copied and pasted everything you used

    I clicked install on that pop and downloaded to the file shown. I just don’t know what is going on. I can’t understand any of this terminology, so I don’t know where I am going wrong.

    1. Hi Rob,
      I had a look at your screenshot but it is not easy to diagnose what is going on without additional tests. It looks like there is something wrong with your version of RGtk2. Could you please share the output to the very first command:
      install.packages(“RGtk2”, type = “source”)
      Does it look anything like what I show in my post?
      Cheers,
      Marco.

      1. Hi marco – i was away from sometime but I still have not been able to get it to work. Without copying and pasting your code above, I was unable to even download rgtk2.

        After using your code i posted a picture of the ending installation message. I can now actually get rattle() to do something and at least maybe make some progress without an immediate error message. The popup box asking me to install is shown in the picture above is what I see.

        If I run install.packages(“RGtk2″, type = “source”)
        without going through the entire process listed above, then I receive an error when attempting to download, and I am forced to recopy and paste your code from the start.

  6. Marco:
    I’ve tried to follow your instructions closely but something is not working. Terminal shows:
    Neils-iMac:~ neiljones$ export PATH=/opt/local/bin:/opt/local/sbin:$PATH
    Neils-iMac:~ neiljones$ sudo port install pkgconfig
    —> Computing dependencies for pkgconfig
    —> Cleaning pkgconfig
    —> Scanning binaries for linking errors
    —> No broken files found.
    Neils-iMac:~ neiljones$ export PATH=/opt/pkgconfig/bin:$PATH
    Neils-iMac:~ neiljones$ sudo port install gtk2 +x11
    —> Computing dependencies for gtk2
    —> Cleaning gtk2
    —> Scanning binaries for linking errors
    —> No broken files found.
    Neils-iMac:~ neiljones$ export PATH_PKG_CONFIG=/opt/local/lib/pkgconfig

    but R shows: Sys.getenv(“PATH”) #path not updated,
    [1] “/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/opt/local/bin”.
    The two packages appear to be installed correctly.
    Setting the path parameter in R does update the path, so that “library(RGtk2)” succeeds, but neither approach to package installation – via terminal or in R – works. rattle() still crashes R.
    To say I’d be grateful for your help would be an understatement!
    Neil

    1. Hi Neil,
      did you try to do steps (5), (6) and (7) as an alternative to (8) and (9)? Not sure why the latter doesn’t work, but try from the terminal directly with (5), (6) and (7), it may be easier to spot errors. The fact that the PATH you set from the terminal does not appear in R is normal because R uses an own copy of the environment. The correct way to set the path in R is to use the sys.setenv() as shown in (8) and (9).
      Let me know whether you made it work or if you still have issues. It should function properly on your iMac as well, provided it is the same OS X and R version as your Mac Book Air.
      Cheers,
      Marco.

  7. Further to my first comment:
    I’ve repeated the process carefully on my macbook air and it has worked, so many thanks for that. Why it doesn’t work on the iMac remains a mystery. Is there any way I can run a test on the installation other than by opening rattle?

    1. Hi Neil,
      unfortunately I don’t know any other way to test rattle than running it. Please see my answer to your other comment. There should be a way to make it run also on your iMac, I don’t see why it shouldn’t. Did you install properly also cairoDevice?
      Cheers,
      Marco.

  8. Very clear instructions. Thank you!

    A couple of points. Check your usage of ‘PKG_CONFIG_PATH’ above, in line 6 of the step-by-step you’re calling it ‘PATH_PKG_CONFIG’ which I think is incorrect.

    I used homebrew to install GTK instead of port, in which case the path to the pkg-config pc file location is; Sys.setenv(PKG_CONFIG_PATH=”/usr/X11/lib/pkgconfig”) – Which is weird because the gtk pc file is located somewhere else. There are a bunch of other pc files in that location which get picked up. Anyway, it worked for me.

    1. Hi John,
      glad it worked for you too.
      Regarding step (8), you are perfectly right. There was a typo on the name of the path variable. I corrected it in the original post, thanks for pointing this out. Usually a copy/paste all my code from the console to make sure it is correct, but obviously I didn’t do that for that little snippet and see what happened… Thanks again for catching the mistake!
      I didn’t try the procedure with Homebrew since Port did the job, good to know it works with it too provided that PKG_CONFIG_PATH is set to the proper (different) location.
      Ciao,
      Marco.

  9. I used homebrew to install GTK instead of port. But, after many tries, still getting this error:

    R CMD INSTALL ~/Downloads/RGtk2_2.20.31.tar.gz
    * installing to library ‘/Library/Frameworks/R.framework/Versions/3.1/Resources/library’
    * installing *source* package ‘RGtk2’ …
    ** package ‘RGtk2’ successfully unpacked and MD5 sums checked
    checking for pkg-config… /usr/local/bin/pkg-config
    checking pkg-config is at least version 0.9.0… yes
    checking for INTROSPECTION… no
    checking for GTK… no
    configure: error: GTK version 2.8.0 required
    ERROR: configuration failed for package ‘RGtk2’
    * removing ‘/Library/Frameworks/R.framework/Versions/3.1/Resources/library/RGtk2’

    1. Hi Alfonso,
      did you install GTK2 with the homebrew equivalent of the port command below?
      sudo port install gtk2 +x11
      From the log file above it is evident to me that the installer still cannot find GTK. RGtk2 and GTK2 are two different things. Installing RGtk2 does not install GTK2.
      Please check once more and let me know in case it still doesn’t work.
      Ciao,
      Marco.

      1. Hi, Marco. Thanks for your support. Yes I installed gtk2 using the equivalent of the port command. Also try port.

        Currently my gtk+-2.0.pc file looks like this:

        prefix=/usr/local/Cellar/gtk+/2.24.25
        exec_prefix=${prefix}
        libdir=${exec_prefix}/lib
        includedir=${prefix}/include
        target=x11

        gtk_binary_version=2.10.0
        gtk_host=x86_64-apple-darwin14.0.0

        Name: GTK+
        Description: GTK+ Graphical UI Library (${target} target)
        Version: 2.24.25
        Requires: gdk-${target}-2.0 atk cairo gdk-pixbuf-2.0 gio-2.0 pangoft2
        Libs: -L${libdir} -lgtk-${target}-2.0
        Cflags: -I${includedir}/gtk-2.0

        But I don’t know how to work it out with the PATH variables. My .bash_profile has these paths:

        export PATH=”/usr/local/Cellar/pkgconfig/bin:$PATH”
        export PATH=”/usr/local/Cellar/gtk+/2.24.25:$PATH”
        export PKG_CONFIG_PATH=/usr/local/Cellar/gtk+/2.24.25/lib/pkgconfig

        1. Finally I could install it, following the recommendations of John Honan on 18 Oct 2014.

          Thanks everybody!

          1. I am working with rattle. But I also want to try some graphs using rggobi. I handle to install ggobi, but having some troubles installing rrgobi:

            > install.packages(“rggobi”, type=”source”)
            Installing package into ‘/Users/athen/Library/R/3.1/library’
            (as ‘lib’ is unspecified)
            trying URL ‘http://cran.rstudio.com/src/contrib/rggobi_2.1.20.tar.gz’
            Content type ‘application/x-gzip’ length 137973 bytes (134 Kb)
            opened URL
            ==================================================
            downloaded 134 Kb

            * installing *source* package ‘rggobi’ …
            ** package ‘rggobi’ successfully unpacked and MD5 sums checked
            checking for pkg-config… /usr/local/bin/pkg-config
            checking pkg-config is at least version 0.9.0… yes
            checking for GGOBI… yes
            configure: creating ./config.status
            config.status: creating src/Makevars
            ** libs
            clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -g -DUSE_EXT_PTR=1 -D_R_=1 /opt/local/include/ggobi -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -fPIC -Wall -mtune=core2 -g -O2 -c RSEval.c -o RSEval.o
            clang: warning: /opt/local/include/ggobi: ‘linker’ input unused
            In file included from RSEval.c:6:
            ./RSGGobi.h:5:10: fatal error: ‘GGobiAPI.h’ file not found
            #include “GGobiAPI.h”
            ^
            1 error generated.
            make: *** [RSEval.o] Error 1
            ERROR: compilation failed for package ‘rggobi’
            * removing ‘/Users/athen/Library/R/3.1/library/rggobi’
            Warning in install.packages :
            installation of package ‘rggobi’ had non-zero exit status

          2. Hi Alfonso,
            from the log file you posted I see the compiler cannot find the GGobiAPI.h file, so it fails. This is either due to it being missing or being placed in a folder which is not included (looked at) by the compiler. Did you try to manually unpack rggobi_2.1.20.tar.gz and check whether the GGobiAPI.h file is in there?
            Cheers,
            Marco.

    1. Hi Andi,
      there are no reasons to believe it wouldn’t work on Yosemite too, even though I didn’t upgrade to it (yet) so I cannot verify myself at this point. Provided you can install GTK, the rest should be no issues at all.
      Cheers,
      Marco.

  10. Hi Marco,

    Thanks for the step by step instructions. It works fine, but you should let everyone know that the environment variable needs to be PKG_CONFIG_PATH (as in your comments on 18 Oct 2014) instead of PATH_PKG_CONFIG as you have in your instructions. I believe that may be the reason why some people are having problems.

    BTW, in case anyone cares, one does not need to install gtk+ using brew, port, or whatever. The prebuilt package GTK_2.24.17-X11.pkg at http://r.research.att.com/#other works fine. It installs as a framework in /Library/Frameworks and the gtk+-2.0.pc file is in the /Library/Frameworks/GTK+.framework/Versions/2.24.X11/Resources/lib/pkgconfig/ directory, which should be the PKG_CONFIG_PATH. One would still need pkg-config, but that can be downloaded from http://pkgconfig.freedesktop.org/releases/ and built (just configure, make, make install), which installs by default in /usr/local/bin (add that to the PATH as per your instructions).

    Best,
    Alan

    1. Hi Alan,
      you are absolutely right about PKG_CONFIG_PATH. The issue had been pointed out to me already by John Hanon but I failed to recognized it. I just cross-checked within the original installation script and PKG_CONFIG_PATH is indeed the correct form. I fixed the original article and credited you and John the in the note at the bottom. Apologies for any inconvenience this may have caused to you and to the other readers.
      Cheers,
      Marco.

  11. Good evening, I have Mac OS { version 10.7.5, and I couldn’t download an R Studio for this version< whatever I found in internet suits version Mac 1.9 and higher? I am in a desperate situation with deleted folders that support Lightroom, could you please help me? Marina
    (I'm sorry I couldn't get rid of those HTML tags and attributes I have nothing to do with)

    1. Hi Marina,
      I am really sorry but I don’t seem to understand your question, especially when you mention Lightroom, which has noting to do with R Studio. Maybe you could try to explain better what your issue is?
      Ciao,
      Marco.

  12. pkg-confg –print-errors module_name found further errors

    Hi Marco,
    Excellent post. It gives enough details for further troubleshooting if required. And in my case, it was required. After following the above instructions, I still got the dreaded 2.8.0 error message. I kept the faith, figuring pkg-config was still the problem. A quick search of 'pkg-config --help' showed the –print-errors option so I tried 'pkg-config --print-errors gtk+-2.0' and it gave me the following message: Package 'xcb-shm', required by 'cairo', not found. I then did a 'find / -name xcb-shm.pc' which found /opt/X11/lib/pkgconfig/xcb-shm.pc. I added that directory to the pk-config path with 'PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/:/opt/X11/lib/pkgconfig' and then both 'R CMD INSTALL RGtk2_2.20.31.tar' and 'R CMD INSTALL cairoDevice_2.20.tar' ran without a hitch. In RStudio, I ran 'install.packages("rattle")'; 'library(rattle)'; then 'rattle()' and up popped the rattle window asking to install the XML package which I did and all now works as it should.

    Again, excellent post. Thank you for sharing the details. It made all the difference.
    Kevan

  13. Thank you so much for this guide – it worked really well for me. I copied and pasted your code into terminal and made just one change which was to drop the “.gz” from both:

    > R CMD INSTALL ~/Downloads/RGtk2_xx.yy.z.tar.gz

    and

    > R CMD INSTALL ~/Downloads/cairoDevice_xx.yy.z.tar.gz

    as my downloaded files ended with .tar

    Once again thank you!

  14. pkg-config –print-errors libname finds more errors

    Hi Marco,
    Thanks for the detailed post. I followed the instructions, first using R CMD INSTALL on the command line after setting PKG_CONFIG_PATH to /usr/local/bin (I used homebrew to install gtk+; it was version 2.24.25), then install.packages() in RStudio and still got the dreaded 2.8.0 error message both times. I kept the faith and figured I still had a problem with the package configuration. I checked and pkg-config includes the option –list-errors. I entered pkg-config --list-errors gtk+-2.0 from which I got the error Package xcb-shm was not found in the pkg-config search path. I did a find / -name xcb-shm -print and found it in directory /opt/X11/lib/pkgconfig/ which I added to PKG_CONFIG_PATH. I was then able to install RGtk2, cairo and rattle with no problems. Very gratifying.
    Again, thanks for the details in the post. Without them, I wouldn’t have had a clue.
    Kevan

  15. Dear experts,

    OS X Yosemite version 10.10.1 MacPorts based version 2.3.3 XQuartz 2.7.7 (xorg-server 1.15.2). I have been trying to install GTK2 +x11 for mac in order to run (RQDA) and (rattle) packages in r/ r studio.

    The problem is, while following the step no. 4, I encountered this error saying that Error: Failed to install tiff

    {{{
    MacBook-Pro:~ Thor$ port version
    Version: 2.3.3
    MacBook-Pro:~ Thor$ export PATH=/opt/local/bin:/opt/local/sbin:$PATH
    MacBook-Pro:~ Thor$ sudo port selfupdate
    —> Updating MacPorts base sources using rsync
    MacPorts base version 2.3.3 installed,
    MacPorts base version 2.3.3 downloaded.
    —> Updating the ports tree
    —> MacPorts base is already the latest version
    The ports tree has been updated. To upgrade your installed ports, you should run
    port upgrade outdated
    MacBook-Pro:~ Thor$ sudo port install pkgconfig
    —> Computing dependencies for pkgconfig
    —> Cleaning pkgconfig
    —> Scanning binaries for linking errors
    —> No broken files found.
    MacBook-Pro:~ Thor$ sudo port install gtk2 +x11
    —> Computing dependencies for gtk2
    —> Dependencies to be installed: gdk-pixbuf2 tiff hicolor-icon-theme pango Xft2 harfbuzz graphite2 xorg-libXcomposite xorg-compositeproto xorg-libXfixes xorg-fixesproto xorg-libXcursor xorg-libXdamage xorg-damageproto xorg-libXi xorg-inputproto xorg-libXinerama xorg-xineramaproto xorg-libXrandr xorg-randrproto
    —> Configuring tiff
    Error: org.macports.configure for port tiff returned: autoreconf failure: command execution failed
    Error: Failed to install tiff
    Please see the log file for port tiff for details:
    /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_graphics_tiff/tiff/main.log
    Error: The following dependencies were not installed: gdk-pixbuf2 tiff hicolor-icon-theme pango Xft2 harfbuzz graphite2 xorg-libXcomposite xorg-compositeproto xorg-libXfixes xorg-fixesproto xorg-libXcursor xorg-libXdamage xorg-damageproto xorg-libXi xorg-inputproto xorg-libXinerama xorg-xineramaproto xorg-libXrandr xorg-randrproto
    To report a bug, follow the instructions in the guide:
    http://guide.macports.org/#project.tickets
    Error: Processing of port gtk2 failed
    MacBook-Pro:~ Thor$
    }}}

    Any help is most appreciated. Cheers!

    1. Hi Thor,
      you seem to have skipped this line in the installation procedure step 4. At least I don’t see it in your log.
      export PATH=/opt/pkgconfig/bin:$PATH
      Could you add it and try again please?
      Cheers,
      Marco.

  16. Thank you very much for the advice. Took four days to find a link that could help me solve these problems. Followed everything, step by step and now, everything’s working just fine. I’m using rattle. God bless!

  17. My UCSD class has gotten Rattle to work. Thanks to you and Github.
    However, I cannot get graphics to work, and in fact on my machine, graphics cause R to crash. Rattle without graphics is not a good teaching platform, so I am spending Saturday trying to fix it.

    Any use of a Rattle plotting option, such as the Explore tab with Describe, creates the following error, in R. Rattle generates an empty new window to display the plot.
    *** caught segfault ***
    address 0x4, cause ‘memory not mapped’

    Traceback:
    1: .Call(“do_asCairoDevice”, widget, as.numeric(pointsize), w, h, PACKAGE = “cairoDevice”)
    2: cairoDevice::asCairoDevice(da)
    3: newPlot(pmax)
    4: executeExplorePlot(avdataset)
    blah blah blah….

    Possible actions:
    1: abort (with core dump, if enabled)
    2: normal R exit
    3: exit R without saving workspace
    4: exit R saving workspace

    I’m using Rattle version 3.4.2, R version 3.1.3 on Mac OS 10.10.3 (or 10.10.2).
    Any suggestions about why R is quitting?

    1. Hi Roger,
      there seems to be something wrong with the installation of your Cairo device, which is what is being used to generate any graphics.
      I would try to update/reinstall the cairo library, but such problems are really difficult to troubleshoot from here.
      Let me know if you make any progress.
      Cheers,
      Marco.

  18. Hi one more question if you please,
    Can you tell a way of loading ggobi in my Mac OSX mavericks ?

    I always get this error
    = 2.1.6) were not met:

    No package ‘ggobi’ found

    Consider adjusting the PKG_CONFIG_PATH environment variable if you
    installed software in a non-standard prefix.

    Alternatively, you may set the environment variables GGOBI_CFLAGS
    and GGOBI_LIBS to avoid the need to call pkg-config.
    See the pkg-config man page for more details.
    ERROR: configuration failed for package ‘rggobi’>

    1. Hi Ayan,
      did you install ggobi first? The instructions are in the README file that comes with rrgobi. Here they are. Let me know if it works.
      Ciao,
      Marco.

      ggobi/rggobi on OS X

      Currently, the easiest way to get rggobi on OS X is to build Gtk2 and ggobi from source using homebrew. This is relatively simple:

      # Install homebrew (if you don’t already have it)
      ruby -e “$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)”

      # Install ggobi from source
      brew install ggobi
      brew install libxml2

      # Set up PKG_CONFIG_PATH so rggobi can find all the pieces
      PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/opt/X11/lib/pkgconfig:/usr/local/opt/libxml2/lib/pkgconfig

      R
      install.packages(“rggobi”, type = “source”)

  19. Hi marco…
    I’m pretty new to “programming” and MAC OS…
    I followed all of the steps and still rattle gives me:
    function (csvname = NULL, dataset = NULL, useGtkBuilder = NULL)
    {
    if (!exists(“crv”)) {
    .onLoad()
    .onAttach()
    }
    sapply(ls(crs), function(x) assign(x, NULL, envir = crs))
    crv$.gtkMain <- FALSE
    if (packageIsAvailable("RGtk2", Rtxt("display the Rattle GUI")))
    suppressPackageStartupMessages(require("RGtk2", quietly = TRUE))
    else stop(sprintf(Rtxt("The RGtk2 package is not available but is required",
    "for the %s GUI."), crv$appname))
    if (missing(useGtkBuilder)) {
    op <- options(warn = -1)
    g <- RGtk2::gtkBuilderNew()

    instead of the window where you can work!

    I got this warning message

    Error : .onLoad failed in loadNamespace() for 'RGtk2', details:
    call: .RGtkCall("S_gtk_builder_get_type", PACKAGE = "RGtk2")
    error: object has no G type
    Error: loading failed
    Execution halted
    ERROR: loading failed
    * removing ‘/Library/Frameworks/R.framework/Versions/3.2/Resources/library/RGtk2’
    * restoring previous ‘/Library/Frameworks/R.framework/Versions/3.2/Resources/library/RGtk2’

    The downloaded source packages are in
    ‘/private/var/folders/ht/z_sw3ccn2qdbmgy7smkmwp7w0000gn/T/RtmpRO7TNj/downloaded_packages’
    Warning message:
    In install.packages("RGtk2", type = "source") :
    installation of package ‘RGtk2’ had non-zero exit status

    I don't know what is wrong :(!!!!
    also, I downloaded the Xquartz but can't find it anywhere… I just have a X11 icon… which opens a terminal and thats it…

    please help 🙁 I need R rattle for college

    thanks a lot,

    Stephany

    1. Hi Stephany,
      it seems like something is wrong with your attempt to install RGtk2, which is a necessary component to have Rattle work properly. Now it is not easy from here to tell where the problem actually is, let alone how to solve it. I would recommend you go over the installation steps again, paying attention to every detail, especially for what concerns the steps leading to RGtk2 installation. Regarding Xquartz it is ok if you don’t see it, that should not be an issue.
      Please try again and let me know if you get any new/different result. Many people have succeeded with installing Rattle according to my instructions, but it took them a couple of tries before they got everything right.
      Best Regards,
      Marco.

  20. Hi Marco,
    My system is Mac OSX 10.7.5 and I am able to install GTK+ and rattle successfully, however, as soon as I start rattle () my X11 window appears and then crashing and ultimately starting a new R session with a warning message that R encounter a fatal error. Please suggest what to do.

    Thanks,

    Subinoy

  21. hey Marco,

    RGtk2 and CairoDevice seem to have installed properly (terminal output at the end of those installs included at bottom), but Rattle installation fails at attempting to install rggobi. any thoughts?

    install.packages(“rggobi”)

    Package which is only available in source form, and may need compilation of C/C++/Fortran: ‘rggobi’
    Do you want to attempt to install these from sources?
    y/n: y
    installing the source package ‘rggobi’

    trying URL ‘https://cran.fhcrc.org/src/contrib/rggobi_2.1.20.tar.gz’
    Content type ‘application/x-gzip’ length 137973 bytes (134 KB)
    ==================================================
    downloaded 134 KB

    * installing *source* package ‘rggobi’ …
    ** package ‘rggobi’ successfully unpacked and MD5 sums checked
    checking for pkg-config… no
    checking for GGOBI… no
    configure: error: in /private/var/folders/q6/pz_c2mv17hn4kd1fd8tjbnhh0000gn/T/RtmpB8z2Ug/R.INSTALL155d57e2f87ef/rggobi':
    configure: error: The pkg-config script could not be found or is too old. Make sure it
    is in your PATH or set the PKG_CONFIG environment variable to the full
    path to pkg-config.

    Alternatively, you may set the environment variables GGOBI_CFLAGS
    and GGOBI_LIBS to avoid the need to call pkg-config.
    See the pkg-config man page for more details.

    To get pkg-config, see .
    See
    config.log’ for more details
    ERROR: configuration failed for package ‘rggobi’
    * removing ‘/Library/Frameworks/R.framework/Versions/3.2/Resources/library/rggobi’

    RGtk2 and CairoDevice installation:

    ** R
    ** demo
    ** inst
    ** preparing package for lazy loading
    ** help
    *** installing help indices
    ** building package indices
    ** testing if installed package can be loaded
    * DONE (RGtk2)

    ** R
    ** demo
    ** preparing package for lazy loading
    ** help
    *** installing help indices
    ** building package indices
    ** testing if installed package can be loaded
    * DONE (cairoDevice)

  22. Pingback: R | SanRin舎

Leave a Reply

Your email address will not be published. Required fields are marked *