Learn R Programming

soccermatics (version 0.9.0)

soccerVelocity: Compute instantaneous distance, speed and direction from x,y-coordinates

Description

Compute instantaneous distance moved (in metres), speed (in metres per second), and direction (in radians) between subsequent frames in a dataframe of x,y-coordinates.

Usage

soccerVelocity(dat)

Arguments

dat

= dataframe containing unnormalised x,y-coordinates `x` and `y`, time variable `t`, and identifier `id`

Value

a dataframe

Examples

Run this code
# NOT RUN {
# calculate distance, speed, and direction for tromso dataset
soccerVelocity(tromso)

# }

Run the code above in your browser using DataLab