Sameer Mathur
pairs(~ mpg + disp + drat + wt, data=mtcars,
main="Basic Scatterplot Matrix")
All the variables on the right of ~ are included in the plot.
Here we can see the bivariate relationship among all the variables specified.
The scatterplotMatrix() function in the car package can also produce scatter plot matrices and can optionally do the following:
Note: LOWESS (Locally Weighted Scatterplot Smoothing), sometimes called LOESS (locally weighted smoothing), is a popular tool used in regression analysis that creates a smooth line through a scatter plot to help you to see relationship between variables.
library(car)
scatterplotMatrix(~ mpg + disp + drat + wt, data=mtcars,
main="car::scatterplotMatrix")
Scatter plot matrix created with the scatterplotMatrix() function. The graph includes kernel density curve and rug plots in the principal diagonal and linear and loess fit lines.