In this chapter, we will cover the following recipes:
In basic data visualization, we usually think about a two-dimensional plot, but in some situations, it is important to produce three-dimensional visualizations in order to see the relationship between variables. In this chapter, we will focus on three-dimensional visualizations using the R libraries in order to create three-dimensional plots. We will mainly cover the basic visualizations such as scatter plots, bar charts, kernel density plots, surface plots, and contour plots.
In this chapter, we will use the airquality
dataset from the datasets
library. This contains 153 observations with the following variables:
Ozone
: Ozone (the mean ozone in parts per billion (ppb) from 1300–1500 hours at Roosevelt Island)Solar.R
: Solar R (the solar radiation in Langleys (lang) in the 4000–7700 Angstroms frequency band from 0800–1200 hours at Central Park)Wind
: The wind (the average wind speed in miles per hour (mph) at 0700 and 1000 hours at LaGuardia Airport)Temp
: The temperature (the maximum daily temperature in degrees Fahrenheit at LaGuardia Airport)Month
: The month (1–12)Day
: The day of the month (1–31)For more details about the dataset, consult the help documentation of this dataset by writing ?airquality
in the R console. Now, let's enter the actual recipe to see the pattern of this data.