ABSTRACT

This chapter presents the fundamentals of data visualization in R using the ggplot2 package. One of R's strengths is that it empowers a large global community of developers to create and disseminate new functionality through user-contributed packages. The data used in the chapter are meteorological observations from the Oklahoma Mesonet, a network of environmental monitoring stations distributed throughout Oklahoma. The mapping argument specifies the aesthetic mapping to use. Mapping aesthetics based on patterns in addition to (or instead of) color is important in many situations. Tick marks and associated text labels indicate how the data are scaled along the axes of the graph. Scatterplots are used to show the relationship between two variables. They are similar to time series plots, but they use points for the geometry, and both axes are measured variables rather than just the y-axis.