Skip to content

Instantly share code, notes, and snippets.

@briandk
Created August 24, 2015 17:37
Show Gist options
  • Save briandk/3b4aa073e8810ea37250 to your computer and use it in GitHub Desktop.
Save briandk/3b4aa073e8810ea37250 to your computer and use it in GitHub Desktop.
An example plot of horsepower vs. displacement
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