Cross Campus 2026

library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr     1.2.0     ✔ readr     2.1.5
✔ forcats   1.0.0     ✔ stringr   1.6.0
✔ ggplot2   4.0.2     ✔ tibble    3.3.1
✔ lubridate 1.9.4     ✔ tidyr     1.3.1
✔ purrr     1.1.0     
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(ggplot2)
Team <- "PRL PRG"
D <- read_csv2("http://data.sportt.cz/results/2026/cvut/cvut.csv", show_col_types = FALSE) |>
     filter(!is.na(Lap1)) |>
     pivot_longer(
      cols = matches("JMENO|Lap"), 
      names_to = c(".value", "Lap_Number"), 
      names_pattern = "(JMENO|Lap)(\\d)"
     )
ℹ Using "','" as decimal and "'.'" as grouping mark. Use `read_delim()` for more control.
nrow(D)
[1] 196
summary(D$Lap)
Time differences in secs
       Min.     1st Qu.      Median        Mean     3rd Qu.        Max. 
02:34:00.00 03:07:45.00 03:28:00.00 03:36:47.45 03:56:00.00 07:12:00.00 
D |> mutate(Ord=dense_rank(Lap)) |> filter(TEAM == Team) |> select(Runner=Lap_Number, Lap, Ord) |> knitr::kable()
Runner Lap Ord
1 03:08:00 23
2 03:20:00 33
3 04:03:00 68
4 03:31:00 44
ggplot(D, aes(x = Lap)) +
  geom_density(fill = "gray90", color = "gray70") +
  geom_vline(data = filter(D, TEAM == Team), 
             aes(xintercept = Lap, color = Lap_Number), 
             linewidth = 0.5) +
  theme_minimal() +
  labs(
    title = "Overall Race Performance",
    y = NULL,
    x = "Lap Time",
    color = "Runner"
  )

ggplot(D, aes(y = "All Laps", x = Lap)) +
  geom_violin(fill = "gray95", color = "gray80") +
  geom_boxplot(width = 0.1, fill = "white", outlier.shape = NA, alpha = 0.5) +
  geom_point(data = filter(D, TEAM == Team), 
             aes(color = Lap_Number), 
             size = 4) +
  
  theme_minimal() +
  labs(
    title = "Overall Race Performance",
    y = NULL,
    x = "Lap Time",
    color = "Runner"
  )