Brought to you by R-Ladies Abuja
This is an introductory talk designed for people who are new to R and want to learn data visualization. In this talk, we will explore a variety of plot types and the different R packages available to bring your design ideas to life. No prior coding experience required or software installation required (no hands on coding).
Slides were generated using Quarto revealjs
List of some of the data visual packages reviewed in this talk.
Package | Great For | Details |
---|---|---|
ggplot2 |
Variety | Popular graphic library. Easy to create variety of plots. |
ggplot extensions | Variety | Libraries that are based off of ggplot2. Extensions can offer more ggplot options like new geoms (e.g. ggbeeswarm ), new themes (e.g. hrbrthemes ) , or new capabilities (gganimate ). |
reactable + reactablefmtr |
Tables | Create interactive html tables |
gt + gtExtras |
Tables | Create interactive html tables. Compatible with R Markdown + Quarto. |
leaflet |
Interactive Maps | R wrapper for leaflet. This package makes it easy to create interactive maps. |
ggiraph |
Interactive Graphics | Specific ggplot2 extension that allows users to create interactive versions of their ggplots. |
highcharter |
Interactive Graphics | R wrapper for highcharter (JS data viz). Allows users to create interactive plots and charts. |
plotly |
Interactive Graphics | Interactive charts |
Don't have your own data to explore? There are bunch of cool data packages you can explore to help you get started. Here are a few:
Package | Category | Description |
---|---|---|
palmerpenguins |
Zoology | An alternative to the iris dataset, great for beginners to explore data visualization. |
nflfastR |
Sports | NFL Football statistics, offers data the play-by-play level |
nbastats |
Sports | NBA stats |
COVID19 |
Health | Data from COVID-19 Data Hub |
spotifyR |
Music | API wrapper to collect spotify data. Requires API token. |
gtrendsR |
Tech | Google Trend Queries |
voteogram |
Politics | U.S. Congress roll call data |
osmdata |
Maps | Open Street Map package for R |
Challenges series are a fun way to learn new data viz tricks, and a great way to meet new people with similar interests. Other data viz challenges to look out for:
-
#TidyTuesday - series created by R for Data Science Online Learning Community. Every Tuesday, a new data set is submitted and participants are invited to analyze and share their own data visualizations using the data.
-
#30DayMapChallenge - usually occurs in November. Tool agnostic challenge, each day features a prompt related to GIS/mapping (e.g. points, choropleth, lines, Open Street Map data, etc). Data is not typically provided, participants are invited to create visuals with data sets of their choice.
-
#30DayChartChallenge - similar to #30DayMapChallenge, this challenge has a specific prompt each day. Usually occurs in April, initially launched in 2022.
There are tons of data visualization tutorials available online. It's impossible to list them all. Here are a few that have helped me in the past:
- Hands On Programming with R - a walk-thru of how to set up R and navigate RStudio. Covers basic R programming concepts.
- ggplot2 cheatsheet - the Posit team created a nice cheatsheet guide to cover the basics and cover the differences between geoms.
- The R Graph Gallery - Blog site maintained by Yan Holtz and other contributors. Coding walk-thrus are available for all types of charts. I frequent this site a lot for inspiration.
- ggplot2 Tutorial for Beautiful Plotting in R - Cédric Scherer's work is exceptional - he's a ggplot2 Data Vizard. I particularly like this post that covers the basics.
- The MockUp- Tom Mock covers a lot of different data and data viz topics on his blog. I love his content on tables. Tom is also the brains behind
gtExtras
- reactablemftr Cookbook - Tons of great examples how to use
reactablefmtr
on Kyle Cuilla's site. - TidyTuesday with David Robinson- If you're learning by watching, David Robinson has a great YouTube series where he walks thru different TidyTuesday prompts in R.
- Highcharter Cookbook - Great blog post by Tom Bishop walking thru different examples of how to render
highcharter
graphics. Maybe more suitable intermediate R users.
Some of my previous ggplot2 workshops:
- Data Storytelling in R - an introductory
ggplot2
workshop I put together with Women Who Code. - Introduction to {ggplot2} - A hands-on introductory workshop I put together for R-Ladies Paris.
- Plotnine Workshop -
plotnine
isggplot2
for Python. This workshop is an introductory lesson, materials available to run in Goolge Collab.