2 min read

Automatically install or update all phylogenetics packages in R

R language for statistical computing

In case you are unaware of this trick, it is possible to simultaneously install or update all of the phylogenetics packages available in R in one fell swoop.

A number of different CRAN Task Views have been created summarizing R packages and utilities for different fields of analysis or research. Luckily, there is not only a compilation of these located on the CRAN-R website here, but also Brian O’Meara (@omearabrian #omearabrian) has developed a nice CRAN Task View entitled “Phylogenetics, Especially Comparative Methods.” This means that you can view all of the software for phylogenetics and phylogenetic comparative methods in R at one time from the corresponding Phylogenetics website. Here is what these websites look like:

CRAN_Task_Views_screenshot Omeara_Phylogenetics_ctv

The most important thing, though, is that you can automatically install the entire Phylogenetics, Especially Comparative Methods view! Here’s how you do it! First, open R, download the ctv package(ctv stands for “CRAN Task Views”), then load the ctv library by typing:

library(ctv)

Next, you can install the Phylogenetics, Especially Comparative Methods view using the ‘install.views’ function, and later you can update this view using the ‘update.views’ function. If this is your first time using R for phylogenetics, you will not have any of the phylogenetics software, so you will do the following to install the view:

install.views('Phylogenetics')

If you have already been working with phylogenies in R and have some of the related packages installed, you will want to use update.views as follows:

update.views('Phylogenetics')

This will check through all of the packages in the Phylogenetics, Especially Comparative Methods view and update packages you already have installed, while also installing for the first time any packages that are missing. Here, an important note to make is that you must 1) be connected to the internet to do this, and 2) realize that this could take a substantial amount of time to install all of the packages. So, only do this when you have time!!

~J