clean_missing_data: Clean missing data above an acceptable threshold

Description Usage Arguments Value Examples

View source: R/clean_and_downsample.R

Description

This function can be used to remove trials and participants who do not meet the threshold for a study. Note that there are two parameters for cleaning, one to remove trials above a threshold, the second to remove participants who drop more than a certain amount of trials.

Usage

1
2
3
4
5
6
clean_missing_data(
  data,
  pupil,
  trial_threshold = 1,
  subject_trial_threshold = 1
)

Arguments

data

your data of class PupillometryR

pupil

a column name denoting pupil size

trial_threshold

a proportion of missing data over which a trial can be considered lost

subject_trial_threshold

a proportion of missing trials over which a participant can be considered lost.

Value

A cleaned PupillometryR dataframe

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data(pupil_data)
Sdata <- make_pupillometryr_data(data = pupil_data,
subject = ID,
trial = Trial,
time = Time,
condition = Type)
new_data <- downsample_time_data(data = Sdata,
pupil = LPupil,
timebin_size = 50,
option = 'mean')
calculate_missing_data(data = new_data, pupil = LPupil)

samhforbes/PupillometryR documentation built on Sept. 14, 2021, 11:50 p.m.