Learn R Programming

soccermatics (version 0.9.5)

soccerResample: Resample the frames per second of any tracking data using linear interpolation

Description

Downsample or upsample any tracking data containing x,y,t data using linear interpolation of x,y-coordinates (plus constant interpolation of all other variables in dataframe)

Usage

soccerResample(df, r = 10, x = "x", y = "y", t = "t", id = "id")

Arguments

df

a dataframe containing x,y-coordinates and time variable

r

resampling rate in frames per second

x, y

name of variables containing x,y-coordinates

t

name of variable containing time data

id

name of variable containing player identifier

Value

a dataframe with interpolated rows added

Examples

Run this code
# NOT RUN {
data(tromso)

# resample tromso dataset from ~21 fps to 10 fps
soccerResample(tromso, r=10)

# }

Run the code above in your browser using DataLab