Rob Kabacoff
Time | Activity |
---|---|
09:05 - 10:00 AM | Session I - Intro to R and ggplot2 |
10:00 - 10:15 AM | Break |
10:15 - 11:15 AM | Session II - Univariate graphs |
11:15 - 11:30 AM | Break |
11:30 AM - 12:30 PM | Session III - Bivariate and Multivariate graphs |
12:30 - 1:30 PM | Lunch Break +Talk SCASA 2022 Regional Statistics Data Visualization Poster Competition |
Time | Activity |
---|---|
1:30 - 2:30 PM | Session IV - Time series, interactive graphs, and maps |
2:30 - 2:40PM | Break |
2:40 - 3:40 PM | Session V - Case Study |
3:40 - 4:00 PM | Book Raffle and Wrap-up |
Importing data
Packages
Access databases with RMySQL, ROracle, RPostgreSQL, RSQLite
Use load() function to open R data files.
Use data() to open package data files.
Data management with the dplyr package
Verbs
Current Population Survey (United States Census)
How does hourly wage relate to years of experience?
Is this relationship constant when considering other factors?
library(ggplot2)
data(CPS85, package="mosaicData")
We'll use ggplot2
and add other packages as we go…
Setting up the graph
Customizing the graph
ggplot( data, aes(…) )
Plotting more than one group of data in a graph using:
legends are automatically created and can be customized.
list of colors
Control how variables are mapped to visual aspects of graph.
scale_color_brewer
many more …
Modifies the non-data components of the plot
appearance of facet strips
can be canned (e.g. theme_minimal ) or custom