Calculates the speed (scalar) in px/frame by comparing centroid location across
flyrun(trx, framelag = 6)
a track data frame (only requires CTrax output variables)
the number of frames to derive speed across; defaults to 6
For each timepoint t the velocity vector is calculated between
Currently this leaves
framelag/2 NAs at the beginning and end of each track. This causes all sorts of problems
and may be best addressed somehow in the future.
speed>50 are also currently
NA'd since that is exclusively artifacts (CTrax already limits jumps to 40 px/frame)
however this again causes holes in the data which become problematic later. Ideally the imputation would be done at the
A numeric vector matching the structure of
trx containing the speed value for each object and timepoint, or
NAs when it can't be calculated.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.