# Step 1: Install and load necessary packages
install.packages("ggplot2")
library(ggplot2)
# Step 2: Create a sample dataset (replace this with your own data)
data <- data.frame(
Group = rep(c("A", "B", "C"), each = 30),
Value = c(rnorm(30), rnorm(30, mean = 1), rnorm(30, mean = 2))
)
# Step 3: Create a boxplot using ggplot2
ggplot(data, aes(x = Group, y = Value)) +
geom_boxplot(fill = "lightblue", color = "darkblue", notch = TRUE) +
theme_minimal() +
labs(title = "Boxplot Example", x = "Group", y = "Value")