This function can be used to assess the amount of samples that have problematic data from each trial, which helps assess cleaning parameters
calculate_missing_data(data, pupil)
your data of class PupillometryR
a column name denoting pupil size
A summary table with number of missing samples in each trial
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')
#> Calculating mean pupil size in each timebin
calculate_missing_data(data = new_data, pupil = LPupil)
#> # A tibble: 48 × 3
#> ID Trial Missing
#> <chr> <fct> <dbl>
#> 1 1 Easy1 0
#> 2 1 Hard1 0
#> 3 1 Easy2 0
#> 4 1 Hard2 0
#> 5 1 Easy3 0
#> 6 1 Hard3 0
#> 7 2 Easy1 0
#> 8 2 Hard1 0
#> 9 2 Easy2 0
#> 10 2 Hard2 0
#> # ℹ 38 more rows