Skip to content

Instantly share code, notes, and snippets.

@othomantegazza
Last active September 28, 2022 17:52
Show Gist options
  • Save othomantegazza/03d50b0a9a60d42ef73ef7019f84c958 to your computer and use it in GitHub Desktop.
Save othomantegazza/03d50b0a9a60d42ef73ef7019f84c958 to your computer and use it in GitHub Desktop.
Dataviz Starter
# some data are already loaded in R
mtcars
# install a package called ggplot2
# with functions for data visualization
# You need to do this only once
install.packages('ggplot2')
# load functions from the package ggplot
# You need to do this only every time you open R
library(ggplot2)
# Make a scatterplot with the data
ggplot(data = mtcars) +
aes(x = disp,
y = hp) +
geom_point() +
geom_smooth()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment