Skip to content

Instantly share code, notes, and snippets.

@selva86
Created March 10, 2020 04:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save selva86/79e73a5d2a409dabdb915e356cbccb38 to your computer and use it in GitHub Desktop.
Save selva86/79e73a5d2a409dabdb915e356cbccb38 to your computer and use it in GitHub Desktop.
# Run the below code to get the graph. The graph represents speed of car
# vs distance it travels before stopping (when brakes are applied)
# In this graph, write an insight stating that "The faster the car,
# the longer it takes to stop"
gg <- ggplot(data=cars, aes(x=speed, y=dist, size=dist)) +
geom_point() +
geom_smooth() +
labs(title="Cars", x="Speed", y="Dist")
print(gg)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment