# UCL R tutoring - Lesson 1 - Student exercises
# Created: 2026-10-30 | v1.0 | Base R only
# Use your own code for each TODO. The data here are synthetic.

student_id  <- paste0("S", 1:8)
study_hours <- c(1, 2, 2, 3, 4, 4, 5, 6)
quiz_score  <- c(42, 48, 55, 62, 69, 74, 82, 90)
group       <- c("A", "B", "A", "B", "A", "B", "A", "B")
class_data <- data.frame(student_id, study_hours, quiz_score, group)

# TODO 1: Create a vector called practice holding 3, 6, 9, 12.

# TODO 2: Find the number of elements in practice and its mean.

# TODO 3: Select only values greater than 6 from practice.

# TODO 4: Find the mean of study_hours in class_data.

# TODO 5: Find the maximum quiz_score in class_data.

# TODO 6: Produce a scatter plot with study_hours on the x-axis,
# quiz_score on the y-axis, and meaningful axis titles.

# BONUS: Find the mean quiz_score of group A without using dplyr.

# Reflection: Write one sentence about the chart.
# Does it establish cause and effect? Why or why not?
