Skip to contents

Function formats split data and calculates split distances, split times and average split velocity

Usage

format_splits(distance, time)

Arguments

distance

Numeric vector

time

Numeric vector

Value

Data frame with the following columns:

split

Split number

split_distance_start

Distance at which split starts

split_distance_stop

Distance at which split ends

split_distance

Split distance

split_time_start

Time at which distance starts

split_time_stop

Time at which distance ends

split_time

Split time

split_mean_velocity

Mean velocity over split distance

split_mean_acceleration

Mean acceleration over split distance

Examples

data("split_times")

john_data <- split_times[split_times$athlete == "John", ]

format_splits(john_data$distance, john_data$time)
#>   split split_distance_start split_distance_stop split_distance
#> 1     1                    0                   5              5
#> 2     2                    5                  10              5
#> 3     3                   10                  15              5
#> 4     4                   15                  20              5
#> 5     5                   20                  30             10
#> 6     6                   30                  40             10
#>   split_time_start split_time_stop split_time split_mean_velocity
#> 1            0.000           1.201      1.201            4.163197
#> 2            1.201           1.967      0.766            6.527415
#> 3            1.967           2.656      0.689            7.256894
#> 4            2.656           3.314      0.658            7.598784
#> 5            3.314           4.591      1.277            7.830854
#> 6            4.591           5.849      1.258            7.949126
#>   split_mean_acceleration
#> 1              3.46644241
#> 2              3.08644622
#> 3              1.05875023
#> 4              0.51958989
#> 5              0.18173012
#> 6              0.09401592