subset_data: Subset data to provide start and finish time windows

Description Usage Arguments Value Examples

View source: R/subset_data.R

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

1
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

1
2
3
4
5
6
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. 14, 2021, 11:50 p.m.