In-Class_Ex03

Author

Khoo Wei Lun

Published

January 28, 2023

Modified

March 11, 2023

Installing and loading R packages

Two packages will be installed and loaded. They are tidyverse and ggiraph.

#pacman::p_load(ggiralph, tidyverse)
#Change to library because of error when running pacman::p_load(ggiralph)
library(ggiraph)
library(tidyverse)

Importing Data

exam_data <- read_csv("data/Exam_data.csv")
p <- ggplot(data = exam_data,
       aes(x = MATHS)) +
geom_dotplot_interactive(
    aes(tooltip = ID),
    stackgroups = TRUE, 
    binwidth = 1, 
    method = "histodot") +
  scale_y_continuous(NULL, 
                     breaks = NULL)
girafe(
  ggobj = p,
  width_svg = 6,
  height_svg = 6*0.618
)