Advanced graphics in R

Basic description of this course

This course is part of a full series of statistics classes, organized by Genotoul - Biostatistics at the INRA (Toulouse) since 2011. Its aim is to present advanced graphic usage in R with ggplot2 and interactive graphic packages. The day is organized into 2 parts

  • a tutorial on ggplot2;
  • a tutorial on interactive graphics.

The tutorial has been held on October 27th 2018 and October 12th 2019 at INRA Toulouse. The course is taught by Sébastien Déjean (IMT, Université Paul Sabatier) and myself. This page gathers information about it and material to download. You are asked to bring your own computer with installed software and packages. RStudio installation is recommended.

How to install R and required packages?

You will be asked to have your own R installation with a list of required packages already installed. We also advise that you install RStudio. The installation steps are described below. In case of difficulty, please, contact me (emails preferred).

   

Install R

I will use R 3.4.1 (2017-06-30) -- "Single Candle".
R can be downloaded for free on the official repository website. Choose the version depending of your OS (Windows, Linux or Mac). Mac users should also probably install tcltk which is available in the section called tools. Some linux users might also found R in their distribution repositories (this is the case for Ubuntu and Debian users; further details are provided at the beginning of this page).
   

Install RStudio

I will use RStudio version Version 1.0.143.
RStudio (Desktop version) can be downloaded for free at this link. Choose the version ("Installers" prefer) depending of your OS (Windows, Linux or Mac). Ubuntu users can install the .deb file with
sudo dpkg -i rstudio-1.0.143-amd64.deb
sudo apt-get install -f
      

Install required CRAN packages

The following packages (available on CRAN) will be required:
  • ggplot2
  • gridExtra
  • RColorBrewer
  • ggnetwork
  • network
  • tidyverse
  • rgl
  • iplots
  • MASS
  • plotly
  • rbokeh
They are installed (with dependencies) using:
install.packages(c("ggplot2", "gridExtra", "RColorBrewer", "ggnetwork", "network",
                   "tidyverse", "rgl", "iplots", "MASS", "plotly", "rbokeh"))
      
We also recommend that you check the installation with
library("...")
      
where ... is a package name. Some of these packages (especially rgl and rbokeh) might require additional software or librairies, such as Java. Do not hesitate to contact me in case of problem during the installation. Please describe precisely the error message (screenshot is a plus) when reporting a problem.

Material for the class

Please make sure you have downloaded all material before the class.