Uses speed and location information to classify entries into
a track data frame
the discriminant speed value between runs and stands. Set at e^-1 on the basis of eyeballed data.
the number of pixels from the rim of the arena to be categorised as edge.
the window for morphological operations
The classification is based on the columns
speed (output of
radius (output of
If these are not already included, they will be calculated ad hoc. Rows with NAs (with the exception of
turn, which is tolerated as it is not used for calculations but has more NAs than anything else)
are removed, then each point is categorised as either edge or not (by a threshold pixel distance
and either run or not (by a threshold pixel/frame speed
sep). Short running/standing bouts are eliminated
by morphological opening and closing over a window of
morph frames. Then, each entry is categorised as either
stand in the classifier variable
whatis - note that there is currently no distinction between
runs and stands in the edge region.
Note: currently the opening/closing is not run by id, so there is a bit of spillage between consecutive tracks, but it should only affect ~4 frames on each side. It would still be best to run the function via ave.
a track data frame that includes the boolean columns
isrun and the factor column
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.