To start: Update your MacOS to version 10.13.3, which takes a little while. You also need Xcode, which can take 20 minutes
A. Download the two key files.
- from https://cran.r-project.org/web/packages/RGtk2/index.html download the source code, latest version of RGtk2. Currently that is 2.20.34.tar.gz
- Some may also need to download Cairo, from https://cran.r-project.org/web/packages/Cairo/index.html
- Depending on your download settings, these will end up in your folder called ~/Downloads
B. One method for installing Rattle is available at https://zhiyzuo.github.io/installation-rattle/. This method does not require Xcode.
C. The second method is on this page.
It requires downloading Xcode, which takes a while, so start on it early. .
1. upgrade your Mac operating system to High Sierra. 10.13.3
2. install Xcode which can be downloaded from App Store. This takes a long time (20 minutes).
3. In the following instructions, write these commands in your Terminal application (available in Applications/Utilities, shift-Cmd-U ). The preface “MyComputer$” will look slightly different on your machine.
MyComputer$ xcode-select -p
### If you see above line, you have xcode command line tools installed.
### If you don’t see that output, execute the command below:
MyComputer$ xcode-select –install
### Then, execute the commands below, in Terminal.
MyComputer$ export PATH=/opt/local/bin:/opt/local/sbin:$PATH
MyComputer$ sudo port selfupdate
MyComputer$ sudo port install pkgconfig
MyComputer$ sudo port install gtk2 +x11
MyComputer$ R CMD INSTALL ~/Downloads/RGtk2_2.20.34.tar.gz
MyComputer$ R CMD INSTALL ~/Downloads/cairoDevice_2.24.tar.gz
### The last two command lines depends on your file names and folders, so make sure that the name is consistent with your own files and folders. For example, when you download RGtk2 and cairoDevice, they may arrive with file names that look like RGtk2_2.20.34.tar (no .gz). If so, use the name on your system.
You can now quit Terminal and start Rstudio. Follow the regular instructions for installing Rattle. For example (from Rstudio, not from Terminal):
install.packages(“rattle”, repos=”https://rattle.togaware.com”, type=”source”)
Once you get this far, you should never have to install Rattle again. You can just run it, from Rstudio or from R. And you won’t have to install.packages again, either. Just:
D. Why all this trouble? – An educational discussion
Despite the inconvenience of this installation, there are some useful lessons here about modern software and software ecosystems. Rattle and R are both open-source software, meaning that no company is formally responsible for their development. Instead, they are built by volunteers (some of whom are paid by their employers to work on the software). The results are that the software is available for free, and portions of it may be very sophisticated, and better than anything available from conventional software companies.
But conversely, with open source software programs the robustness (it doesn’t break) and usability (non-specialists can use it ) depends on how popular that program is, which determines how much effort the open source software community puts into developing it. The core pieces of R and Rstudio are both heavily used and relatively well developed. Rstudio, on the other hand, is more limited. The inventory, Graham Williams, as far as I can tell uses Linux and Windows, but does not use Macintosh software. Therefore, when he updates Rstudio he develops and tests it first for Windows. Other users then have to come along and test/adapt it for Mac. The same situation appears to be true for several packages that Rattle and many other R packages depend on.
The same situation applies to some packages that Rattle depends on, especially something called RGtk2. As of today (4/5/2018), the CRAN page for RGtk2 says the following:
|Windows binaries:||r-prerel: RGtk2_2.20.34.zip, r-release: RGtk2_2.20.34.zip, r-oldrel: RGtk2_2.20.31.zip|
|OS X binaries:||r-prerel: not available, r-release: not available|
In other words, there is no compiled (binary) version of version 2.20.34 of RGtk2 for Macintosh operating system. What you are doing in the above instructions is compiling it yourself, so that it will be available when Rattle wants it.