pacman::p_load(ggiraph, tidyverse)In-Class Exercise 03
Installing and Loading R Packages
Two packages will be installed and loaded. They are tidyverse and ggiraph.
Importing Data
This code chunk is to import the data from Exam_data.csv file to the Quarto/R page.
exam_data <- read_csv("data/Exam_data.csv")Exploration and Trial
Graphs and Visualization through ggplot2 and ggiraph
ggplot(data=exam_data,
aes(x = MATHS)) +
geom_dotplot(dotsize = 0.5)
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
)