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 player identifier 'id'
Value
a dataframe with columns 'dist', 'speed', and 'direction' added