Line graphs are normally used to visualize relationships between two continuous variables along the x axis and y axis; that is, how the continuous variable on the x axis changes its relation with respect to another continuous variable on the y axis. Line graphs can also be used with a discrete variable on the x axis and are appropriate when the variable is ordered as such (small, medium, and large).
Creating line graphs
Getting ready
Download the book's files for this chapter and save the mtcars.csv file in your R working directory. Install and load the ggplot2 library and then read the data into R using the read.csv() command:
> install.packages("ggplot2")
> library(ggplot2)
> mtcars <- read.csv(...