Scatter plots are used primarily to conduct a quick analysis of the relationships among different variables in our data. It is simply plotting points on the x-axis and y-axis. Scatter plots help us detect whether two variables have a positive, negative, or no relationship. In this recipe, we will study the basics of plotting in R using scatter plots. The following screenshot is an example of a scatter plot:
For implementing the basic scatter plot in R, we would use Carseats data available with the
ISLR package in R.
We will also start this recipe by installing necessary packages using the