set_start_frame: Set a new starting frame

Description Usage Arguments Details Value Examples

View source: R/by_trial_operation.R

Description

Pick a new frame as the starting frame, which will become frame 1. You can use either a single frame number for all trials using value, or you can supply a different frame number for each trial using tab.

Usage

1
2
set_start_frame(tracks, value = NULL, tab = NULL, frame = "frame",
  trial = "trial")

Arguments

tracks

A tracks object.

value

A single value to set as the start frame.

tab

A data.frame with trial names and start frames. Use frame and trial to choose which variables are used.

frame

The column from tab that is used as the starting frame. By default this is 'frame'.

trial

The column from tab that is used as the trial identifier. By default this is 'trial'.

Details

All values below the start frame will be filtered out.

Value

A tracks object.

Examples

1
2
3
4
5
6
7
8
9
  Guppies <- as_tracks(guppies, 30, '1080p')
  # Normally this dataset starts from frame 10000:
  Guppies$tr
  # But we can easily set that to 1 instead:
  set_start_frame(Guppies, 10000)$tr
  # Or we can use different frame numbers per trial:
  frame_table <- data.frame(trial = c('a', 'b'), frame = c(5000, 10000))
  set_start_frame(Guppies, tab = frame_table)$tr
  # Since some frames were fropper,

Ax3man/trackr documentation built on Oct. 8, 2019, 10:53 p.m.