For more information about creating and annotating a composite figure, please visit Chapter 7.

Figure 0.1: For more information about creating and annotating a composite figure, please visit Chapter 7.

This book (https://smin95.github.io/dataviz) guides the reader to be familiar with R, a programming language, for data visualization. It also introduces the R package smplot2, which aims to make the process of data visualization simple. This book was created entirely using RMarkdown for reproducibility. The secondary link of the e-book is: https://smin95.com/dataviz.

The old website (on smplot) can be accessed using this link (https://smin95.com/dataviz0).


Here is the only (and slightly outdated) reference for smplot2:

Seung Hyun Min, Jiawei Zhou. smplot: An R Package for Easy and Elegant Data Visualization (2021). Frontiers in Genetics, 12:802894. pdf

The codes of the figures in the report are here but these depend on smplot, not smplot2.

Here is the reference for the smCSF package (Chapters 13-16):

Seung Hyun Min, Alexandre Reynaud. Applying resampling and visualization methods in factor analysis to model human spatial vision (2024). Investigative Ophthalmology and Visual Science.

Installation of smplot2

As of April 2024, smplot2 is now part of the CRAN repository. Please install using install.packages() for the most stable version.


If users wish to download the most updated version of smplot2 (most recent version: from 2024-05-24), please use install_github(). This might be necessary if some codes from the documentation webpage do not work in RStudio as intended.

devtools::install_github('smin95/smplot2',force = T)

Issues and contact

If you spot any mistakes in this online book, please pull-request on Github or email me . If you find issues with the smplot2 package, please pull-request on Github.


This tutorial is under a Creative Commons Attribution 4.0 International License. I am the sole creator of smplot2.

About the author

I am Assistant Professor in Dept. Ophthalmology and Optometry at Wenzhou Medical University. On June 2021, I received my PhD at McGill University under the supervision of Dr. Robert F. Hess. My research is focused on amblyopia, neural plasticity and binocular vision. During spare time, I play the clarinet and develop R packages. More details, such as my publications, are on my website: https://www.smin95.com.