library(ggplot2)
# Create the example dataset
study_data <- data.frame(
Hours = c(5, 3, 8, 4, 6, 7, 2, 9, 1, 10, 5, 4, 2, 8, 6, 7, 3, 9,
10, 1, 5, 7, 6, 8, 3, 4, 2, 9, 10, 1),
Score = c(75, 60, 90, 65, 80, 85, 55, 95, 50, 100, 70, 65,
60, 90, 85, 80, 62, 92, 96, 48, 73, 83, 87, 88,
55, 68, 59, 90, 94, 46)
)
# Create the scatter plot
ggplot(data = study_data, aes(x = Hours, y = Score)) +
geom_point() +
xlab("Hours of Study") +
ylab("Exam Score") +
ggtitle("Scatter Plot of Study Hours and Exam Scores")