Instantly share code, notes, and snippets.

What would you like to do?

Installing rggobi

The two scripts below give the most up-to-date instructions for installing rggobi on windows and mac. They should install everything you need, from Gtk2 to ggobi to rggobi.

To install:

  • On windows, copy and paste windows.r into R, and then run install_all().

  • On the mac, open the terminal, and copy and paste the commands from below

If you have problems, try:

  • Installing the latest version of R

  • (On windows) Running R as administrator (right click on the shortcut to R and click "Run as administrator")

If you still have problems, please email the ggobi mailing list, providing any error messages as well as the output from sessionInfo() in R.

# Install gtk
curl -O
open GTK_2.18.5-X11.pkg
# Install ggobi
curl -O
sudo tar fvxz ggobi-2.1.8-darwin9-bin3.tar.gz -C /
# Install rggobi
export PATH=/usr/local/ggobi/bin:/Library/Frameworks/GTK+.framework/Resources/bin:$PATH
export PKG_CONFIG_PATH=/usr/local/ggobi/lib/pkgconfig:/Library/Frameworks/GTK+.framework/Resources/lib/pkgconfig
install.packages("rggobi", type = "source")
## depending on where you installed GTK+, you may need to run this script as administrator
## (right click on the shortcut of R --> Run as administrator)
#' @param reinstall If TRUE, reinstall everything
install_all <- function(reinstall = FALSE) {
oldwd <- setwd(tempdir())
cran <- ""
# Gtk and RGtk2 ------------------------------------------------------------
if (!is_installed("gtk") || reinstall) {
message("Installing Gtk")
url <- ""
download.file(url, basename(url), mode = "wb")
if (!is_installed("rgtk2") || reinstall) {
message("Installing RGtk2")
install.packages("RGtk2", repos = cran)
# Missing dlls -------------------------------------------------------------
gtk_path <- dirname(Sys.which("libcairo-2.dll"))
if (!is_installed("libxml2")) {
message("Installing libxml2")
url <- ""
download.file(url, file.path(gtk_path, "libxml2.dll"), mode = "wb")
if (!is_installed("iconv")) {
message("Installing iconv")
url <- ""
download.file(url, file.path(gtk_path, "iconv.dll"), mode = "wb")
# GGobi and rggobi ---------------------------------------------------------
if (!is_installed("ggobi") || reinstall) {
message("Installing GGobi")
ggobi.url <- ""
download.file(ggobi.url, basename(ggobi.url), mode = "wb")
if (!is_installed("rggobi") || reinstall) {
message("Installing rggobi")
install.packages("rggobi", repos = cran)
message("Installation completed. Run the following code to test")
message("library(rggobi); ggobi(mtcars)")
is_installed <- function(pkg) {
in_path <- function(x) length(Sys.which(x)) > 0
pkg_installed <- function(x) system.file(package = x) != ""
ggobi = in_path("ggobi"),
rggobi = pkg_installed("rggobi"),
gtk = in_path("libcairo-2.dll"),
rgtk2 = pkg_installed("RGtk2"),
libxml2 = in_path("libxml2.dll"),
iconv = in_path("iconv.dll")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment