Add the packages that you’ll use:

library(lubridate)
library(tidyverse)

I am creating this test data here, and hiding the code to keep it simple :)

bib gender age cun_start cun_end sec_start sec_end
1 male 34 01:52 02:01 01:52 02:01
2 male 33 01:53 01:55 01:53 01:55
3 female 46 01:51 01:52 01:51 01:52
4 male 46 01:53 01:56 01:53 01:56
5 male 28 01:52 01:56 01:52 01:56
6 female 45 01:51 01:53 01:51 01:53
7 male 38 01:53 01:54 01:53 01:54
8 male 31 01:51 01:53 01:51 01:53
9 female 26 01:51 01:53 01:51 01:53
10 female 42 01:53 01:54 01:53 –|–

To process your stations data:

See code, followed by explanation below

# create a new dataframe, called stations from data
stations <- data |> 
  mutate_at(vars(-bib, -gender, -age), ~hm(.)) |> 
  mutate(cun_diff = period_to_seconds(cun_end - cun_start)/60,
         sec_diff = period_to_seconds(sec_end - sec_start)/60) 
## Warning: There was 1 warning in `mutate()`.
## ℹ In argument: `sec_end = (structure(function (..., .x = ..1, .y = ..2, . =
##   ..1) ...`.
## Caused by warning in `.parse_hms()`:
## ! Some strings failed to parse

Explanation of the above code:

Convert all of the start and end times from characters to time in hours minutes and seconds

Calculate the time spent at the station, in seconds

Now you have:

kable(stations)
bib gender age cun_start cun_end sec_start sec_end cun_diff sec_diff
1 male 34 1H 52M 0S 2H 1M 0S 1H 52M 0S 2H 1M 0S 9 9
2 male 33 1H 53M 0S 1H 55M 0S 1H 53M 0S 1H 55M 0S 2 2
3 female 46 1H 51M 0S 1H 52M 0S 1H 51M 0S 1H 52M 0S 1 1
4 male 46 1H 53M 0S 1H 56M 0S 1H 53M 0S 1H 56M 0S 3 3
5 male 28 1H 52M 0S 1H 56M 0S 1H 52M 0S 1H 56M 0S 4 4
6 female 45 1H 51M 0S 1H 53M 0S 1H 51M 0S 1H 53M 0S 2 2
7 male 38 1H 53M 0S 1H 54M 0S 1H 53M 0S 1H 54M 0S 1 1
8 male 31 1H 51M 0S 1H 53M 0S 1H 51M 0S 1H 53M 0S 2 2
9 female 26 1H 51M 0S 1H 53M 0S 1H 51M 0S 1H 53M 0S 2 2
10 female 42 1H 53M 0S 1H 54M 0S 1H 53M 0S NA 1 NA

Next steps: