Enrollment and Follow-Up Monitoring Plots
Code Example 1
Code
6 / 10
Code Example 1
Code
Code Example 1
r
cumulative_enrollment <- prepared_data |>
distinct(participant_id, enrollment_date, site) |>
arrange(enrollment_date) |>
mutate(cumulative_participants = row_number())
cumulative_enrollment |>
ggplot(aes(x = enrollment_date, y = cumulative_participants)) +
geom_line() +
labs(
title = "Cumulative Enrollment Over Time",
x = "Enrollment date",
y = "Cumulative participants"
)