Description Usage Arguments Value Examples

View source: R/clean_and_downsample.R

This function is useful if you were sampling at a very high frequency (eg 500Hz) causing the data size to be hard to manage, and high autocorrelation. Careful decisions should be made about the time bin size and appropriateness of this function, with respect to the data type.

1 | ```
downsample_time_data(data, pupil, timebin_size, option = c("mean", "median"))
``` |

`data` |
your data of class PupillometryR |

`pupil` |
a column name denoting pupil size |

`timebin_size` |
the size of the new timebin you wish to use |

`option` |
what should be calculated in each timebin - mean or median. Defaults to mean. |

A downsampled dataframe of class PupillometryR

1 2 3 4 5 6 7 8 9 10 | ```
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')
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.