ch.filterFastSubjects: A function to exclude participant whos RT is to fast

View source: R/ch.filterFastSubjects.r

ch.filterFastSubjectsR Documentation

A function to exclude participant whos RT is to fast

Description

This function adds a legend to a plot.

Usage

ch.filterFastSubjects(
  data,
  rtCol,
  subCol,
  trialCol = NULL,
  fast_ms = 250,
  trial_percent = 0.1,
  outputFileName = NULL,
  append = TRUE,
  plotFilename = NULL,
  removeFastResponses = FALSE
)

Arguments

data

a dataframe with the trial by trial responses.

rtCol

a string that specifies the name of the column in "data" that contains the RT data.

subCol

a string that specifies the name of the column in "data" that contains the subject identifiers.

trialCol

a string that specifies the name of the column in "data" that contains the trial number. It is used to plot the data. DEFAULT = NULL (no plots)

fast_ms

an integer identifying the ms threshold, equal to or below which are considered too fast. DEFAULT = 250

trial_percent

a proportion (between 0-1) that identifies the proportion of trials below fast_ms that disqualify a participant. DEFAULT = 0.1

outputFileName

a string specifying the output file name

append

a boolean that specifies whether to append the ouput to the file if it exists. DEFAULT = TRUE.

plotFilename

A string that identifies the name of file (.pdf) in which the plot will be saved. The default is NULL, whereby the plot will not be saved.

removeFastResponses

a boolean that specifies whether to remove individual fast RT trials from final dataset. DEFAULT = FALSE.

Value

a list that contains datRemoved = the data that was removed; datKept = the data that was kept; numRemoved = the number of subjects removed; pRemoved = the percent of subjects removed

Examples

ch.filterFastSubjects(df.data, "rt", "sn")

ccpluncw/ccpl_R_chutils documentation built on Nov. 22, 2024, 5:18 a.m.