Created
August 24, 2015 17:37
-
-
Save briandk/3b4aa073e8810ea37250 to your computer and use it in GitHub Desktop.
An example plot of horsepower vs. displacement
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(dplyr) | |
library(ggplot2) | |
car_performance_data <- | |
mtcars %>% select(hp, disp) | |
horsepower_vs_displacement <- | |
ggplot( | |
aes( | |
x = disp, | |
y = hp | |
), | |
data = car_performance_data | |
) + | |
geom_point() + | |
geom_smooth() + | |
xlab( | |
expression(Displacement ( cm^3)) | |
) + | |
ylab("Horsepower") | |
print(horsepower_vs_displacement) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment