install.packages(c("cowplot","crosstalk","dplyr","DT","gganimate","ggiraph",
"ggplot2","ggpubr","ggrepel","ggthemes","grid","gridExtra",
"gt", "kableExtra","leaflet","palmerpenguins","patchwork",
"pheatmap","plotly","reshape2","scales","Seurat","shiny",
"tidyr","tidyverse","wesanderson"), dependencies = TRUE)Installations
R
Download and install the latest version of R from r-project.org.
IDE
Install RStudio or Positron. RStudio/Positron provides you with tools like code editor with highlighting, project management, version control, package building, debugger, profiler and more. Visual Studio code is another good alternative to RStudio/Positron.
Quarto
Download and install the latest version of Quarto from quarto.org.
R packages
Install all the R packages necessary for this course by opening an R terminal either in Rstudio or VScode and pasting the following command:
To make sure that the installations went well, we will try to make a quick plot using the packages you just installed. In this plot, we try to see if there is correlation plot between BMI and average no.of steps taken by some volunteers per day. The data and the code for plotting is available here. Just render or preview the installation_check.qmd file in RStudio or VScode. and you should see the correlation plot, if all the packages are installed properly.
HackMD
We will use the online note-keeping document from HackMD for our questions. Please click here to see the notebook. We would appreciate it a lot if you could write your questions and feedback here, so that all participants can learn from each other.
Preparations
To prepare for the course, you can follow one of the links below to warm up your skills necessary for the course.
- Beginner-level: Basic warm-up exercises in R
- Advanced-level: ggplot warm-up
Alternative installations with containers
Docker
If you are more familiar with using Docker, all the tools necessary for the course are available as a Docker image. You can pull the image using the following command:
docker pull ghcr.io/nbisweden/workshop-adv-data-viz:latest
If you would like to try to install Docker and give it a try, please follow the instructions here
Visual Studio code
The best and most efficient way to work with the Docker image is with VScode and the extension Dev Containers. Similar to RStudio or Posit, VScode is an IDE maintained by Microsoft and it is quite efficient and robust for all Operating systems.
- To install VScode, follow the instructions here
- After successful installation of VScode and Docker, you can install the
Dev Containersextension for VScode from here - Download the
Dev Containerfile from here Make sure that all the course related files are in the same place as this.devcontainer.jsonhidden file - Then in
VScode, pressCtrl+Shift+P(Cmd+Shift+Pfor Mac users) followed by enteringDev Containers: Open Folder in Containerin the prompt to select the folder where you have all the files orDev Containers: Reopen in Container, if you are already on VScode in the same directory. - Now, if everything worked fine, a new window should appear inside the
Advanced Data Visualizationcontainer.
Apptainer
If for some reason, the installations doesn’t work on your computer and you happened to have access to any of the Swedish HPCs (non-sensitive) like in NAISS. You can follow the instructions below:
In some cases in Dardel HPC from KTH, you might have to load the apptainer module first. The example below explains how one could do it in Dardel.
module load PDC apptainer
Followed by:
apptainer pull workshop.sif ghcr.io/nbisweden/workshop-adv-data-viz:latest
apptainer exec workshop.sif code tunnel
Then follow the on-screen instructions to login with your GitHub account (for example). By following these steps you should have access to all the tools. You can also download all the course files into your HPC at the same location as the workshop.sif file and you should be able to access it in the apptainer. Alternatively, you can also open specific folder in HPC where you have all the workshop related materials from the VS code graphical interface (File --> Open Folder).