ABSTRACT

The “gg” part of ggplot2 stands for “grammar of graphics”, which is the idea that most graphs can be made using the same few “pieces.” The data we will work on is data about alcohol consumption in US states from 1977-2017 from the National Institutes of Health. It contains the per capita alcohol consumption for each state for every year. Their method to determine per capita consumption is amount of alcohol sold / number of people aged 14+ living in the state. Some useful types of graphs are: geom_point();geom_line();geom_bar(); and geom_smooth(). The chapter presents a time-series of beer consumption in Pennsylvania. Many time-series plots show multiple variables over the same time period.