New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running Retistruct GUI in MacOS X Mavericks and Yosemite #4

Open
davidcsterratt opened this Issue Mar 5, 2015 · 2 comments

Comments

Projects
None yet
2 participants
@davidcsterratt
Owner

davidcsterratt commented Mar 5, 2015

On MaxOS X Mavericks and Yosemite, Retistruct installs OK, and demo("retistruct.method") works, but it fails when running the package with the command retistruct(), with the error output:

> retistruct()
Loading required package: gWidgetsRGtk2
Trying to install required package gWidgetsRGtk2

   package ?gWidgetsRGtk2? is available as a source package but not as a binary

Warning in install.packages :
  package ?gWidgetsRGtk2? is not available (for R version 3.1.2)
Loading required package: gWidgetsRGtk2
Error in require.package(paste0("gWidgets", guiToolkit)) : 
  Could not install gWidgetsRGtk2
In addition: Warning messages:
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return
= TRUE,  :
  there is no package called ?gWidgetsRGtk2?
2: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return
= TRUE,  :
  there is no package called ?gWidgetsRGtk2?
> I am trying to run it from RStudio using the latest version of R (2.1.2) under
> Mac OS X Yosemite. I have re-installed the latest version of X11.

The problem is that retistruct depends on the gWidgetsRGtk2 package, which in turn depends on the RGtk2 package, and unfortunately this package is hard to install on Mavericks (Mac OS X
10.9), and probably also hard to install on Yosemite. There are a number of possibilities, none of which I've tried myself as I don't have a Mac.

0. Use GTK binaries

Chris von Csefalvay's method appears to be the most straightforward way of installing RGtk2. Ignore the references to rattle, another package that depends on RGtk2.

1. Use macports

Try installing RGtk2 using the "Step by step solution" here, which uses macports:
http://marcoghislanzoni.com/blog/2014/08/29/solved-installing-rattle-r-3-1-mac-os-x-10-9/
In a comment some way down the page, the author says the instructions should work for Yosemite, but there's no guarantee. Once you've installed RGTK2, you will (I think) have to install gWidgetsRGTK2 manually from within RStudio (or R):

      install.packages("gWidgetsRGTK2", type="source")

Then retistruct should work.

2. Use Homebrew

Thanks to @bcohn12 for suggesting this. In a terminal copy and paste:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install gtk+
export PKG_CONFIG_PATH=/usr/X11/lib/pkgconfig:$PKG_CONFIG_PATH  
R
> install.packages(c("cairoDevice", "RGTk2"), type="source") 

However, I'm guessing that you may need to install XCode and XQuartz manually beforehand, if they are not already installed.

3. Run R in (docker)[http://www.docker.com]

Thanks to @sje30 for suggesting trying to run R in docker, as discussed here: rocker-org/rocker#110

brew install socat
brew cask install xquartz # SJE didn't need this step. 
open -a XQuartz 

socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\" 

# in another window
docker run -e DISPLAY=192.168.59.3:0 -ti --rm r-base
install.packages("retistruct")
retistruct()
@sje30

This comment has been minimized.

Show comment
Hide comment
@sje30

sje30 Apr 9, 2015

hi @davidcsterratt, I just ran across these comments, which may well be similar to route 1.
http://chrisvoncsefalvay.com/2015/02/08/installing-gtk-on-mavericks.html

sje30 commented Apr 9, 2015

hi @davidcsterratt, I just ran across these comments, which may well be similar to route 1.
http://chrisvoncsefalvay.com/2015/02/08/installing-gtk-on-mavericks.html

@davidcsterratt davidcsterratt changed the title from Running retistruct GUI in MacOS X Mavericks and Yosemite to Running Retistruct GUI in MacOS X Mavericks and Yosemite May 11, 2015

@davidcsterratt

This comment has been minimized.

Show comment
Hide comment
@davidcsterratt

davidcsterratt May 11, 2015

Owner

Thanks for the pointer @sje30 - I've added this as method 0, as it appears to be the most straightforward.

Owner

davidcsterratt commented May 11, 2015

Thanks for the pointer @sje30 - I've added this as method 0, as it appears to be the most straightforward.

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