Creating single-variable plots
Single-variable plots are mostly used to visualize the distribution of a variable. Using these kinds of graphics, it is possible to understand more of your dataset, evaluate where there is data concentration, data symmetry, or skewness, and visualize how the data behaves in comparison to the mean and detect patterns.
Dataset
The dataset chosen for this chapter comes from the datasets
library; it is named mtcars. It is a widely known toy dataset for you to play with to learn coding and Data Science. For our goal here, which is understanding how to create each graphic, it presents itself as one of the best options because it is about a common subject (cars) and it has many variable numerical and categorical types for us to create different visualizations. If you want to know more about the variables, feel free to write help("mtcars")
on your console in R. To load the dataset into an R session, just use the code that follows:
data("...