Skip to content

Summary

  • ggplot2 uses a grammar of graphics for plotting
  • ggplot2 expects tidy data

  • Using ggplot2:

ggplot(data, aes(x = x, y = y)) + geom_point()
  • Saving a ggplot, directly after plotting:
ggsave("my_filename.png")
  • R uses the arrow operator for assignment
my_variable <- 3.14
  • swirl can be used as a tool to learn R
library(swirl)
swirl()
  • Use readr to load data from a file
library(tidyverse)
read_csv("my_data.csv")

Where to go from here?