framerate_expand: Expand a data set containing onset/offset columns to reflect...

Description Usage Arguments Value Examples

View source: R/exported.R

Description

Expand a data set containing onset/offset columns to reflect their frame numbers.

Usage

1
framerate_expand(.data, fps, keep_ts = TRUE)

Arguments

.data

A data.frame with onset and offset columns.

fps

The frames per second corresponding to the coded video.

keep_ts

Whether to keep the onset and offset columns in the data.

Value

A data.table with the added column frame_number

Examples

1
2
3
4
5
my_data <- data.frame(onset=1000, offset=1999, code="hello")
framerate_expand(my_data, 30)

my_data2 <- data.frame(onset=c(-1, 0), offset=c(100, 125), x=c(".", "-"))
framerate_expand(my_data2, 30)

iamamutt/datavyur documentation built on Dec. 20, 2021, 5:57 p.m.