This repo contains materials for the 'Data Visualization - Introduction to ggplot2
' Eco-Data-Science workshop on January 17, 2018 at UCSB. The objective is to introduce basics of creating and customizing graph using ggplot
, including:
- The grammar of graphics
- General structure of
ggplot()
code - Customizing axes labels and titles
- Customizing graph aesthetics (by variable)
- Faceting (
facet_wrap
) - Types of graphs (geoms)
- Bar graphs (stacked counts, proportions, and clustered)
- Exporting graphs (
ggsave
)
- Install the
tidyverse
package if you don't have it already (ggplot2
package is part of thetidyverse
) - Load the dataset
np_visit.csv
(a file containing visitor counts at National Parks in the United States)