• Home

R 3.4 For Mac


Rattle: Installation on Macintosh OS X (Leopard and Lion)

Install Guide

The definitive guide to installing rattle on the Mac as of June2018 comes via Zhiya Zuowhere Yihui Xie (RStudio) notedthat he has pre-built the binaries of RGtk2 and cairoDevice so that wecan easily install rattle. Thanks to Yihui. Note thathttps://macos.rbind.org has disappeared and has probably been replacedby https://macos.rbind.io.

Asara Senaratne tested the following steps 2020-08-03:

  • You need to have macports installed. Select the correct one based on your OS from this https://www.macports.org/install.php and install it.
  • If you already have a terminal running, restart it and run the command: sudo port install gtk2 ## (X11 -- not aqua).
  • Then, run: export PATH=/opt/local/bin:/opt/local/sbin:$PATH
  • Run 'R' in the terminal to get the R command line and run: install.packages('RGtk2',type='source')
  • Next, run: install.packages('rattle',type='source')
  • Install: install.packages('rpart.plot') to get the plots
  • Restart R and try: library(rattle); rattle()
  1. This directory contains binaries for a base distribution and packages to run on Mac OS X (release 10.6 and above). Mac OS 8.6 to 9.2 (and Mac OS X 10.1) are no longer supported but you can find the last supported release of R for these systems (which is R 1.7.1) here.
  2. Last released version for Mac OS X 10.4 (Tiger) was R 2.10.1, last release for Mac OS X 10.5 (Leopard) was R 2.15.3, last release for Mac OS X 10.11 (El Capitan) was R 3.6.3. Other binaries The following binaries are not maintained or supported by R-core and are provided without any guarantee and for convenience only (Mac OS X 10.4.4 or higher.

Eric Lin provided the following steps 2020-03-03. If asked toinstall by source say yes. If at any time during the process you areprompted for dependencies to be installed press yes. If you had afailed installation previously run brew doctor first to clearpotential problems. If there is a recommendation for a cleanup runbrew cleanup

  • Open up your Terminal.
  • You will need to install XCode Command Line Tools before installing R. We can install that by copy/pasting into terminal and pressing enter: xcode-select --install
  • Go to homebrew's website and copy/paste the command into terminal from here: https://brew.sh/
  • To install R, copy/paste this into your terminal and press enter: brew install r
  • We need some dependencies for Rattle: brew install gtk+
  • Ensure cairo does not exist yet (if you get an error that it doesn't exist that's fine): brew uninstall --force cairo --ignore-dependencies
  • Next: brew cask install xquartz
  • Next: brew install --with-x11 cairo
  • Now enter this command as capitalised: R
  • Copy and paste these commands one at a time within R and when asked for CRAN press 4 (ignore any warnings and note it may run for a while):
  • If asked to install dependencies or by source make sure to select yes.
  • This should install everything, including dependencies, successfully. If it does type the following to close R: q()
  • Enter back in: R
  • Load rattle library: library(rattle)
  • Load rattle: rattle()

    The material below is for archival purposes and generally can beignored though retained here in case it helps others. Also, fortrouble shooting see the Rattle Install Trouble Shooting.

    Alternative Install Guides

    Other contributions are included for information. Thanks to everyonewho has contributed to getting Rattle running smoothly on the Mac.
    • Roger Bohn of UCSD, April 2018, Mac OS X 10.13.4, R 3.4.4, X, RGtk 2.20.34, Rattle 5.1.3
    • Zhiya Zuo Sep 2017, Mac OS X >= 10.11, R 3.4.1, XQuartz, RGtk 2.20.33, Rattle 5.0.14
    • Marco Ghislanzoni Aug 2014, Mac OS X 10.9.4, R 3.1.1, XQuartz, GTK
    • Seb Kopf Jun 2014, Mac OS X 10.9.4, R 3.1.1, XQuartz, GTK 2.24

    Old Instructions

    Please ensure you have at least

    • Mac OS/X 10.12
    • XQuartz instead of X11
    • R 3.4.1 GUI 1.63 Snow Leopard build (6660)
    • GTK 2.24.17-X11
    • install.packages('rattle', repos='http://rattle.togaware.com', type='source”)

    Thanks to Rashid Zaman [140331] and Ivan Salgo [140603] forconfirming these requirements.Further information on installing the right version of GTK for Rversion 3 can be found on GitHub.Geoffrey Brown [150320] reports that for OSX 10.6.8, R 3.1.3 heinstalled XCode 3.2.6 and then install.packages('RGtk2',type='source') which worked for him.

    Quick Start

    • Install R
    • Startup R and then
    • > install.packages('RGtk2')
      > install.packages('rattle')
      > q()
    • Restart R and then
    • > library('rattle')
      > rattle()

    The rest of the required libraries get installed as you use Rattle.We install RGtk2 and the Gtk libraries separately as they can takesome time to download and install.

    The details are below.

    Dev Release

    The latest development version is available directly from Togaware:

    If you have issues with Rattle, then installing the latestdevelopment version is probably a good place to start.


    1. Install Latest R

    The first step is to install R

    • Download and install the latest version of R from CRAN, the Comprehensive R Archive Network. The link to R-latest.pkg will deliver the latest. Choosing all the defaults on the install works just fine.

    2. Install Rattle

    Then install Rattle using R's package manager. As a separate stepit is usually best to install the RGtk2 package which will downloadthe GTK libraries for Mac OS/X and link them into R. This can takesometime and is a prerequisite for loading Rattle.

    • Start R and enter the following command at the R prompt. R asks us to nominate a CRAN mirror. Choose a nearby location.

    • Restart R and then load Rattle with the following two commands at the R prompt. This loads the Rattle package into the library and starts up Rattle.

    Note on Installation of Rattle on Mountain Lion

    Thanks to Joe Trubisz for this script that he tested on severaldifferent machines and confirms it works (15 November 2013).

    1. Start R
    2. > install.packages('RGtk2', dependencies=TRUE)
    3. > install.packages('rattle', dependencies=TRUE)
      Wait ..
    4. Once done, q()
      If you have a 'unable to load' issue, then you most likely do not have the correct GTK+ library for Mountain Lion. If you have this issue, then kill X11 and R, go to ATT and download: GTK_2.24.17-X11.pkg and install it.
    5. Restart R
    6. > library(RGtk2)
      Once X11 starts, go to the task bar and select X11->Check forupdates. If there is an update, do the update, q() after theupdate and kill X11. If no update is present, skip to step 8.
    7. Redo steps 5 and 6 above
    8. demo(appWindow)
      Make sure that you can close the window successfully.
      If you are here, then you should be able to:
    9. > library(rattle)
    10. > rattle()

For trouble shooting see the Rattle Install Trouble Shooting.

R 3.4.4 has been released, and binaries for Windows, Mac, Linux and now available for download on CRAN.

Copyright © 2006-2019 Togaware Pty Ltd
This site is hosted in the cloud by Web Faction.
Last Modified Saturday 2020-08-08 18:53:28 AEST Graham Williams

Shop atAmazon

Peter Langfelder and Steve Horvath
with help of many other contributors

Semel Institute for Neuroscience and Human Behavior, UC Los Angeles (PL),
Dept. of Human Genetics and Dept. of Biostatistics, UC Los Angeles (SH)
Peter (dot) Langfelder (at) gmail (dot) com,SHorvath (at) mednet (dot) ucla (dot) edu
BMC Bioinformatics, 2008 9:559(link opens in a new tab/window)

Quick navigation


Correlation networks are increasingly being used inbioinformatics applications. For example,weighted gene co-expression network analysis is a systems biologymethod for describing the correlation patterns among genesacross microarray samples. Weighted correlation network analysis(WGCNA) can be used for finding clusters (modules) of highly correlatedgenes, for summarizing such clusters using the moduleeigengene or an intramodular hub gene, for relating modules to one another and to external sample traits(using eigengene network methodology), and for calculating modulemembership measures. Correlation networks facilitate network basedgene screening methods that can be used to identify candidatebiomarkers or therapeutic targets. These methods have beensuccessfully applied in various biological contexts, e.g. cancer,mouse genetics, yeast genetics, and analysis of brain imaging data. While parts ofthe correlation network methodology have been described in separate publications, there is aneed to provide a user-friendly, comprehensive, and consistentsoftware implementation and an accompanying tutorial.

The WGCNA R software package is a comprehensive collection of Rfunctions for performing various aspects of weighted correlationnetwork analysis. The package includes functions for networkconstruction, module detection, gene selection, calculations oftopological properties, data simulation, visualization, andinterfacing with external software. Along with the R package wealso present R software tutorials. While the methods developmentwas motivated by gene expression data, the underlying data miningapproach can be applied to a variety of different settings.

Getting started with R and Weighted Gene Co-expression Network Analysis

The package described here is an add-on for the statistical language and environment R (freesoftware).Our tutorials contain step bystep instructions such that even complete novice users should be able to get started in R immediately.

Readers wishing to learn about the theory and published applications of WGCNA are invited tovisit the WGCNAmain page.

R Tutorials

A comprehensive set of tutorials that illustrate various aspects of WGCNA is available. We offer not only introductory tutorials thatintroduce basic functionality of the package, but also more advanced analyses in which we used the WGCNApackage in our own research.

Click here to access the tutorial page.

Further reading

Peter Langfelder occasionally writes about WGCNA features and other topicsrelating to data analysis. The articles are written for a general audience and try to avoid deep technical details. We also have a few technical reports that discuss aselected deeply technical aspects of the WGCNA methodology - these are more mathematical and targeted primarilly todie-hard statistician geeks.

Automatic installation from CRAN

R 3.4 For Mac Shortcut

The WGCNA package is now available from the Comprehensive R Archive Network (CRAN), the standard repositoryfor R add-on packages. Currently, some of the required packages is only available from Bioconductor and needto be installed using Bioconductor's installation tools. The easiest way to do this is


The first command (install.packages('BiocManager')) can be skipped if the package BiocManager is already installed.

This will install the WGCNA package and all necessary dependencies. The catch is that this only installsthe newest version of WGCNA if your R version is also the newest (minor) version.Users using older versions of R will need to follow the manual download andinstallation instructions below.

Note for Mac users: CRAN occasionally fails to compile the WGCNA package for Mac OS X. This leads to the error message 'Package WGCNA is not available..' when callingBiocManager::install(). If this occurs, please download the binary version from here and follow the installationinstructions (or, if you are able to compile packages locally, download the source and install that).

Note of caution: The newest versions of WGCNA is available from CRAN only for the current Rversion and (usually) one older version. For example, if your R version is 3.2.1 and the current R version on CRAN is 3.5.0, the automaticinstallation and update will not use the newest version of WGCNA. Please update your R to the newest versionor use the manual download below.

Problems installing or using the package? Please see our list of frequently askedquestions. Your problem and the solution may already be posted there.

Manual download and installation

Please follow these steps only if the automatic package installation above does not work.


The current version of the WGCNA package will only work with R version 3.0.0 and higher. If youhave an older version of R, please upgrade your R.

The WGCNA package requires the following packages to be installed: stats, grDevices, utils, matrixStats (0.8.1 or higher), Hmisc, splines, foreach, doParallel, fastcluster, dynamicTreeCut,survival, parallel, preprocessCore, GO.db, impute, and AnnotationDbi.If your system does not have them installed, the easiestway to install them is to issue the following command at the R prompt:

install.packages(c('matrixStats', 'Hmisc', 'splines', 'foreach', 'doParallel', 'fastcluster', 'dynamicTreeCut', 'survival'))
biocLite(c('GO.db', 'preprocessCore', 'impute'))

Best program for coding c mac. Please note that GO enrichment calculations in WGCNA are deprecated; we recommend using the R package anRichment which provides replacement for WGCNA functions GOenrichmentAnalysis() anduserListEnrichment().

If you run an older version of R, the above may not install the newest version of the dynamicTreeCutpackage. Should you encounter this problem, please manually download and install dynamicTreeCut from this web page.

R package download and installation:Package WGCNA_1.69-81 (last updated 2020/04/30) is available here as source code and several pre-compiledversions for various platforms. In general it is preferable to download the source and compile the packagelocally; however, if this is not practical, please select an appropriate compiled version.

  • Source for Linux and all users able to compile the package locally: WGCNA_1.69-81.tar.gz
  • Compiled binary Mac OS X:WGCNA_1.69.tgz
  • Comiled binary for Windows running R-3.4.0 or higher: WGCNA_1.69.zip
  • Reference manual in pdf format
  • Quick reference: overview table of most important functions
  • A terse changelog
If you require a compiled version, please make sure you select the correct version. We are unable toprovide compiled binaries for other versions of R and/or operating systems; please upgrade your R if you are running an old versionnot listed here.

The package version numbers follow the formatpackageName_major.minor-revision. Minor versions typically add or change some functionality;revisions typically contain bugfixes or minor enhancements.

Should you discover bugs (of which there are most likely plenty), please report them to Peter Langfelder.

Problems installing or using the package

Please see our list of Frequently Asked Questions (and frequently given answers);the solution to your problem may lie there. In particular, you can find answers about spurious Macerrors, compatibility problems when upgrading WGCNA, and others. If you still cannot solve the problem, email PeterLangfelder.

Old versions of R package WGCNA

Older version of the packages presented on this page are available here.

Citing the WGCNA package

If you use WGCNA in published work, please cite it to properly credit people who have created it.

The WGCNA as an analysis method is described in

  • Zhang B and Horvath S (2005) A General Framework for Weighted Gene Co-Expression Network Analysis, Statistical Applications in Genetics and Molecular Biology: Vol. 4: No. 1, Article 17 PMID: 16646834

The package implementation is described in the article

R 3.4 For Mac High Sierra

If you use any q-value (FDR) calculations, please also cite at least one of the following articles:

  • Storey JD. (2002) A direct approach to false discovery rates. Journal of the Royal Statistical Society, Series B, 64: 479-498.
  • Storey JD and Tibshirani R. (2003) Statistical significance for genome-wide experiments. Proceedings of the National Academy of Sciences, 100: 9440-9445.
  • Storey JD, Taylor JE, and Siegmund D. (2004) Strong control, conservative point estimation, and simultaneous conservative consistency of false discovery rates: A unified approach. Journal of the Royal Statistical Society, Series B, 66: 187-205.

If you use the collapseRows function to summarize/convert probe-level data to gene-leveldata, please cite

  • Miller JA, Cai C, Langfelder P, Geschwind DH, Kurian SM, Salomon DR, Horvath S (2011) Strategies foraggregating gene expression data: The collapseRows R function. BMC Bioinformatics 12:322.

If you use module preservation calculations, please cite

  • Langfelder P, Luo R, Oldham MC, Horvath S (2011) Is my network module preserved and reproducible? PloSComp Biol. 7(1): e1001057

If you use functions rgcolors.func, plotCor, plotMat,stat.bwss, or stat.diag.da, please also cite the article

  • Sandrine Dudoit, Yee Hwa Yang, Matthew J. Callow, and Terence P. Speed, Statistical methods for identifying differentially expressed genes in replicated cDNAmicroarray experiments, STATISTICA SINICA 2002, 12:111

R 3.4 For Mac Catalina


The core of the functions and other code was written by Peter Langfelder and Steve Horvath, partlybased on older code written by Steve Horvath and Bin Zhang. Multiple people contributed additional code,most prominently Jeremy Miller, Chaochao (Ricky) Cai, Lin Song, Jun Dong, and Andy Yip. The package alsocontains code adapted from external packages that were either orphaned (such as package sma) ortheir development has made the code difficult to use in WGCNA (such as package qvalue). A big thanks goes out to people who continue report the many bugs in the package.

R 3.4 For Mac Os

The package is currently maintained by Peter Langfelder.

R 3.4 For Mac