R Tutorial: Data Visualization Best Practices in R

An R course on data visualization using ggplot2 and tidyverse, covering proportions, point data, and distributions across four chapters. The instructor uses WHO disease data from 1980-2016 to show how simple plots reveal trends like a rubella spike in the early 2000s, while emphasizing that visualization rules are guidelines to break when needed.
Chapters
Welcome to Data Visualization Best Practices in R. Hopefully, by the end of this course, data visualization will have transitioned from just another step in your data science pipeline to an integral part of your data exploration and question answering toolkit. Let's get Started the main objective of this course is to help you pull upon experience and general concepts to think deeply about the data you are working with and make the best visualization for the problem at hand. We will do this by looking at a variety of different data types, point data proportions and distributions, and discussing the pros and cons of the standard visualization types you are probably familiar with. In addition, we will cover alternative visualizations that solve issues that often arise with the standard methods. Over the four chapters of this course we will discuss proportions, data and its common visualizations, plus ways to improve them. We will then move on to point data in chapter two, single distribution data in chapter three, and finally comparing multiple distributions to each other in Chapter four. Before we get started, a warning is necessary. Many topics we will discuss will not be cut and dry like most of programming mercifully is the rules and principles we will go over are usually the best path, but there are lots of instances where you have to break one or more of these rules that we cover. For whatever reason. By the end of the course, you will have all of the tools you need to weigh the pros and cons of different techniques or chart types and choose the best for your problem. The overall lessons of this course can be applied in any tool you may use to make visualizations, be it Excel, Tableau or Microsoft Paint. However, this course itself will be taught using R and specifically the tidyverse set of data manipulation packages with ggplot2 for plots. For this reason, I highly recommend completing the datacamp courses on these packages before starting here. That way you can focus on the concepts instead of the nuances of the implementation. For the first two chapters, we will use a dataset obtained from the World Health Organization or WHO that details counts of seven different measles, mumps, diphtheria, pertussis, part polio, rubella, and yellow fever across different countries from the years 1980 to 2016. It contains columns on the region that the country resides, such as AMR for America, a three letter country code and full country name, the disease, the year of the observation, and finally the number of cases observed for the given disease. These data are rich and offer us a lot of opportunities to employ different visualization techniques. For instance, to get a feel for the dataset, we may want to plot a simple scatter of the number of cases observed for a given region over time. To do this, we will filter the data to the American region and then feed the filtered data to ggplot with the point geometry with X mapped to the year, Y mapped to case counts, and the color mapped to the disease. From this simple plot, we can see that there was an interesting spike of rubella in the early 2000s, and measles used to be a bigger deal than it currently is. We will investigate these patterns in better visualizations and greater depth in the chapters to come. Enough of me talking at you. Let's get our feet wet by getting to know this dataset a little bit more with some exploration.
More from Richie

#359 My Best Friend is AI with Valerie Tiberius, Professor of Philosophy at University of Minnesota

How AI Agents Will Work While You Sleep | Ruslan Salakhutdinov, Professor at Carnegie Mellon

#358 How AI Agents Will Work While You Sleep | Ruslan Salakhutdinov, Professor at Carnegie Mellon







