Visualizations and Interactive Graphics using R

✏️ Haley Jeppson, Brian Habing
🗓 April 12, 2023
⏰ 1:00 PM - 5:00 PM CDT



Schedule

Activity
Session 1: Introduction to ggplot2
Session 2: ggplot2 concepts
Session 3: Advanced Customization
Session 4: Extensions & Interactivy



Prerequisites

We will be working with the most recent stable versions of R and RStudio, as well as with a number of additional packages.

Install R and RStudio

You will need:

R version >= 4.1 RStudio >= 2022.02.1

Review

This ebook provides an introduction to R programming and serves as a companion to the data visualization workshop at NCME.

Install the necessary CRAN packages

my_packages <- c("rmarkdown", "knitr", "tidyverse",
                 'patchwork', "cowplot",  'colorspace', 
                 'ggtext', 'ggokabeito', 'ggthemes',
                 'ggdist', 'GGally', 'ggrepel', 
                 'ggpubr', 'ggstatsplot', 'ggdag', 
                 'plotly', 'ggiraph')

install.packages(my_packages)

Install R package development toolchain

(installation notes from Ian Lyttle)

For Windows with no admin rights

Download the latest (recommended) Rtools installer, Rtools.exe, from https://cran.r-project.org/bin/windows/Rtools/. Run the installer keeping the default settings.

For Windows with admin rights

Download the latest (recommended) Rtools installer, Rtools.exe, from https://cran.r-project.org/bin/windows/Rtools/. Run the installer making the following selections: keep the default settings for the installation location and components to install; check the box to add rtools to the system PATH.

For Mac

Install XCode. Either:

  1. Download and install XCode from the Mac AppStore: http://itunes.apple.com/us/app/xcode/id497799835?mt=12
  2. Within XCode go to Preferences : Downloads and install the Command Line Tools

Or for a smaller download size:

  1. Register as an Apple Developer (free) here: https://developer.apple.com/programs/register/
  2. Download the Command Line Tools for XCode appropriate for the version of OS X you are running from here: https://developer.apple.com/downloads/

For Linux

If you installed r-base-dev, when installing R, you should have all you need to build packages from source. Otherwise return to the instructions for installing R for your distribution and follow the instructions there to install the additional tools.

Install the devtools and NCME23data packages

The aim of devtools is to make package development easier by providing R functions that simplify and expedite common tasks. The R Packages book and the Building Tidy Tools workshop are based on a devtools workflow.

Install devtools:

install.packages("devtools")

After installing the R package development toolchain and devtools, you can verify your system is set up by running:

devtools::has_devel()

Install NCME23data from GitHub:

devtools::install_github("haleyjeppson/NCME23data")

Install ggcorrplot from GitHub:

devtools::install_github("kassambara/ggcorrplot")