First, make sure you install and load the esquisse package using install.packages and library:

install.packages("esquisse")
install.packages("ggplot2")
library(esquisse)
library(ggplot2)
library(jhur)

1.1

Try creating a plot using the Orange data that automatically comes with R using the esquisse package.

# esquisser(Orange)
ggplot(Orange) +
  aes(x = age, y = circumference) +
  geom_point(shape = "circle", size = 1.5, colour = "#112446") +
  theme_minimal() +
  facet_wrap(vars(Tree))

ggplot(Orange) +
  aes(x = age, y = circumference, colour = Tree) +
  geom_point(shape = "circle", size = 1.5) +
  scale_color_hue(direction = 1) +
  theme_minimal()

1.2

Click where it says “point” (may say “auto” depending on how you did the last question) on the far left side and change the plot to a different type of plot. Copy and paste the code into the chunk below. Close Esquisse and run the chunk below to generate a ggplot.

ggplot(Orange) +
  aes(x = age, y = circumference, colour = Tree) +
  geom_line(size = 0.5) +
  scale_color_hue(direction = 1) +
  theme_minimal()
## Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
## ℹ Please use `linewidth` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.

Practice on Your Own!

P.1

Launch Esquisse on any selection of the following datasets we have worked with before and explore!

yts <- read_yts()
tb <- read_tb()
bike <- read_bike()
## Rows: 1631 Columns: 9
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (6): subType, name, block, type, project, route
## dbl (3): numLanes, length, dateInstalled
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
circ <- read_circulator()
## Rows: 1146 Columns: 15
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr  (2): day, date
## dbl (13): orangeBoardings, orangeAlightings, orangeAverage, purpleBoardings,...
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
vacc <- read_csv("http://jhudatascience.org/intro_to_r/data/USA_covid19_vaccinations.csv")
## Rows: 64 Columns: 125
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr   (1): State/Territory/Federal Entity
## dbl (121): Total Doses Delivered, Doses Delivered per 100K, 18+ Doses Delive...
## lgl   (3): People with 2 Doses by State of Residence, People 18+ with 1+ Dos...
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
# esquisser(vacc)