Scatter plots are one of the most popular graphs for data analysis; they are used to display the relationship between two quantitative variables, and are similar to line graphs in that they use horizontal and vertical axes to plot data points. Simply put, scatter plots show the relationship between two variables and how much one variable is affected by another.
Creating scatter plots
Getting ready
Make sure that the auto-mpg.csv file is in the working directory of R. Read the file using the read.csv command and save in the auto variable. Convert cylinders to a factor variable. If you have not done so already, install the ggplot2 package as follows:
> install.packages("ggplot2")
> library(ggplot2)
> auto <...