Scatter Plot (Basic)

Want to learn more? I recommend working through: R for Data Science, R Cookbook, and R Graphics Cookbook.

# load the ggplot2 package
library(ggplot2)
# plot using base graphics
plot(mtcars$wt, mtcars$mpg)

png

# plot using ggplot2
ggplot(mtcars, aes(x=wt, y=mpg)) + geom_point()

png