Last updated: 2025-10-15

Checks: 6 1

Knit directory: data_visualization_in_R/

This reproducible R Markdown analysis was created with workflowr (version 1.7.1). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.


The R Markdown file has unstaged changes. To know which version of the R Markdown file created these results, you’ll want to first commit it to the Git repo. If you’re still working on the analysis, you can ignore this warning. When you’re finished, you can run wflow_publish to commit the R Markdown file and build the HTML.

Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.

The command set.seed(20251007) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.

Great job! Recording the operating system, R version, and package versions is critical for reproducibility.

Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.

Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.

Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.

The results in this page were generated with repository version 9e1856e. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.

Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:


Untracked files:
    Untracked:  analysis/01_intro_data_viz.Rmd
    Untracked:  analysis/02_intro_to_ggplot2.Rmd
    Untracked:  analysis/03_heatmap_demystified.Rmd
    Untracked:  analysis/04_practical_scRNAseq_viz.Rmd

Unstaged changes:
    Modified:   analysis/about.Rmd
    Modified:   analysis/index.Rmd

Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.


These are the previous versions of the repository in which changes were made to the R Markdown (analysis/index.Rmd) and HTML (docs/index.html) files. If you’ve configured a remote Git repository (see ?wflow_git_remote), click on the hyperlinks in the table below to view the files as they were in that past version.

File Version Author Date Message
Rmd 9e1856e crazyhottommy 2025-10-07 Start workflowr project.

Welcome to Data Visualization in R

This workshop is designed to teach you the fundamentals of creating compelling, publication-quality visualizations using R and ggplot2. Whether you’re a biology student, researcher, or data analyst, mastering data visualization is essential for exploring your data and communicating your findings effectively.

Learning Objectives

By the end of this workshop, you will be able to:

  • Understand the principles of effective data visualization
  • Create the 6 essential plot types used in 90% of scientific publications
  • Apply the grammar of graphics using ggplot2
  • Customize plots with themes, colors, and annotations
  • Work with real genomics data from The Cancer Genome Atlas (TCGA)
  • Create publication-ready figures for your research

Workshop Structure

Lesson 1: Introduction to Data Visualization

Learn the fundamental principles of effective data visualization, including when to use different plot types and best practices for visual communication.

Lesson 2: Practical ggplot2

Master the core visualization types using real TCGA cancer genomics data: - Scatter plots and correlation analysis - Histograms for distribution exploration - Boxplots and violin plots for group comparisons - Bar plots for summary statistics

Lesson 3: Heatmaps Demystified

Deep dive into creating and customizing heatmaps - the 6th essential plot type for genomics research.

Lesson 4: Advanced Single-cell RNA-seq Visualization

Specialized techniques for visualizing single-cell RNA sequencing data.

Prerequisites

  • Basic knowledge of R programming
  • R and RStudio/Positron installed
  • Required R packages: tidyverse, readr, dplyr, ggplot2

Data

We’ll be working with real-world data from The Cancer Genome Atlas (TCGA), focusing on gene expression across different cancer types. This provides practical experience with the types of data you’ll encounter in genomics research.

Getting Started

  1. Download the TCGA gene expression dataset
  2. Install required packages:
install.packages(c("tidyverse", "readr", "dplyr", "ggplot2", "Polychrome", "forcats"))
  1. Start with Lesson 1: Introduction to Data Visualization

This workshop uses the workflowr framework for reproducible research. Each lesson builds upon the previous one, so we recommend following them in order.


sessionInfo()
R version 4.4.1 (2024-06-14)
Platform: aarch64-apple-darwin20
Running under: macOS Sonoma 14.1

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRblas.0.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.12.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: America/New_York
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] workflowr_1.7.1

loaded via a namespace (and not attached):
 [1] vctrs_0.6.5       httr_1.4.7        cli_3.6.3         knitr_1.48       
 [5] rlang_1.1.4       xfun_0.52         stringi_1.8.4     processx_3.8.4   
 [9] promises_1.3.0    jsonlite_1.8.8    glue_1.8.0        rprojroot_2.0.4  
[13] git2r_0.35.0      htmltools_0.5.8.1 httpuv_1.6.15     ps_1.7.7         
[17] sass_0.4.9        fansi_1.0.6       rmarkdown_2.27    jquerylib_0.1.4  
[21] tibble_3.2.1      evaluate_0.24.0   fastmap_1.2.0     yaml_2.3.10      
[25] lifecycle_1.0.4   whisker_0.4.1     stringr_1.5.1     compiler_4.4.1   
[29] fs_1.6.4          pkgconfig_2.0.3   Rcpp_1.0.13       rstudioapi_0.16.0
[33] later_1.3.2       digest_0.6.36     R6_2.5.1          utf8_1.2.4       
[37] pillar_1.9.0      callr_3.7.6       magrittr_2.0.3    bslib_0.8.0      
[41] tools_4.4.1       cachem_1.1.0      getPass_0.2-4