library(ggplot2)
# Vehicle price by type
ggplot(cars93, aes(x = price)) +
geom_histogram(binwidth = 5) +
facet_wrap(~type)
# Vehicle price vs. weight
ggplot(cars93, aes(x = weight, y = price)) +
geom_point()
# Milleage vs. weight
ggplot(cars93, aes(x = weight, y = mpg_city)) +
geom_point() +
geom_smooth()
Run the code above in your browser using DataLab