Installation instructions for R packages

To install R for the first time, or to replace an outdated version of R, download the appropriate version of R from its website.

If you are working on a Mac we would also recommend installing Rstudio, which can be downloaded from its website here.

Make sure that you have the most recent version of R. You can check your R version by typing the command R.version into an R command prompt. The current version of R is:

R.version
##                _                           
## platform       x86_64-w64-mingw32          
## arch           x86_64                      
## os             mingw32                     
## system         x86_64, mingw32             
## status                                     
## major          3                           
## minor          4.1                         
## year           2017                        
## month          06                          
## day            30                          
## svn rev        72865                       
## language       R                           
## version.string R version 3.4.1 (2017-06-30)
## nickname       Single Candle

To install packages, open a new session of R. No other sessions of R should be currently running.

Next, copy & paste the following commands to your R command prompt:

install.packages("ape",repos="https://cloud.r-project.org",quiet=TRUE)
install.packages("caper",repos="https://cloud.r-project.org",quiet=TRUE)
install.packages("diversitree",repos="https://cloud.r-project.org",quiet=TRUE)
install.packages("geiger",repos="https://cloud.r-project.org",quiet=TRUE)
install.packages("nlme",repos="https://cloud.r-project.org",quiet=TRUE)
install.packages("OUwie",repos="https://cloud.r-project.org",quiet=TRUE)
install.packages("phangorn",repos="https://cloud.r-project.org",quiet=TRUE)
install.packages("phytools",repos="https://cloud.r-project.org",quiet=TRUE)

The result should looks something like this:

install.packages("ape",repos="https://cloud.r-project.org",quiet=TRUE)
## package 'ape' successfully unpacked and MD5 sums checked
install.packages("caper",repos="https://cloud.r-project.org",quiet=TRUE)
## package 'caper' successfully unpacked and MD5 sums checked
install.packages("diversitree",repos="https://cloud.r-project.org",quiet=TRUE)
## package 'diversitree' successfully unpacked and MD5 sums checked
install.packages("geiger",repos="https://cloud.r-project.org",quiet=TRUE)
## package 'geiger' successfully unpacked and MD5 sums checked
install.packages("nlme",repos="https://cloud.r-project.org",quiet=TRUE)
## package 'nlme' successfully unpacked and MD5 sums checked
install.packages("OUwie",repos="https://cloud.r-project.org",quiet=TRUE)
## package 'OUwie' successfully unpacked and MD5 sums checked
install.packages("phangorn",repos="https://cloud.r-project.org",quiet=TRUE)
## package 'phangorn' successfully unpacked and MD5 sums checked
install.packages("phytools",repos="https://cloud.r-project.org",quiet=TRUE)
## 
##   There is a binary version available but the source version is
##   later:
##          binary source needs_compilation
## phytools 0.6-00 0.6-20             FALSE
## installing the source package 'phytools'

You can check package versions as follows:

packageVersion("ape")
## [1] '4.1'
packageVersion("caper")
## [1] '0.5.2'
packageVersion("diversitree")
## [1] '0.9.10'
packageVersion("geiger")
## [1] '2.0.6'
packageVersion("nlme")
## [1] '3.1.131'
packageVersion("OUwie")
## [1] '1.50'
packageVersion("phangorn")
## [1] '2.2.0'
packageVersion("phytools")
## [1] '0.6.20'

Your package versions should match (or be more recent - that is, have higher values) than the package versions listed above.

Written by Liam J. Revell. Last updated 28 July 2017.