removeExceptionalValues: removeExceptionalValues

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/removeExceptionalValues.R

Description

A function to replace exceptional values with NA. This can be used to quickly remove impossible values, for example, when participants entered their age as 344.

Usage

1
2
removeExceptionalValues(dat, items = NULL, exception = 0.005,
                        silent = FALSE, stringsAsFactors = FALSE)

Arguments

dat

The dataframe containing the items to inspect.

items

The items to inspect.

exception

How rare a value must be to be considered exceptional (and replaced by NA).

silent

Can be used to suppress messages.

stringsAsFactors

Whether to convert strings to factors when creating a dataframe from lapply output.

Details

Note that exceptional values may be errors (e.g. participants accidently pressed a key twice, or during data entry, something went wrong), but they may also be indicative of participants who did not seriously participate in the study. Therefore, it is advised to first use exceptionalScores to look for patterns where participants enter many exceptional scores.

Value

The dataframe, with exceptional values replaced by NA.

Author(s)

Gjalt-Jorn Peters

Maintainer: Gjalt-Jorn Peters <gjalt-jorn@userfriendlyscience.com>

See Also

exceptionalScores

Examples

1

userfriendlyscience documentation built on May 2, 2019, 1:09 p.m.