subset_data: Subset data to provide start and finish time windows

View source: R/subset_data.R

subset_dataR Documentation

Subset data to provide start and finish time windows

Description

subset_data can be used on a PupillometryR dataframe to subset the time into relevant chunks. This, ideally should be one of the first runctions run, before anything analytical. Use this to indicate a start and stop time to create a new resized dataframe.

Usage

subset_data(data, start = NULL, stop = NULL, rezero = T, remove = T)

Arguments

data

a PupillometryR dataframe

start

a single number indicating start time of new dataframe

stop

a single number indicating end time of new dataframe

rezero

logical, whether time should start from zero

remove

logical, remove observations outside of start and stop

Value

a subsetted PupillometryR dataframe

Examples

Sdata <- make_pupillometryr_data(data = pupil_data,
                               subject = ID,
                               trial = Trial,
                               time = Time,
                               condition = Type)
subset_data(Sdata, start = 100, stop = 10000, rezero = TRUE, remove = TRUE)

samhforbes/PupillometryR documentation built on Sept. 25, 2023, 10:19 a.m.