Learn R Programming

surveydata (version 0.2.0)

removeDK: Removes "Don't know" from levels and replaces with NA.

Description

Tests the levels of x contain any instances of "Don't know". If so, replaces these levels with NA

Usage

removeDK(x, dk = "Don't Know")

Arguments

x

Character vector or factor

dk

Character vector, containing search terms, e.g. c("Don't know", "Don't Know")

Value

A factor with "Dont know" removed

See Also

Other Functions to clean data: encToInt, fixCommonEncodingProblems, fixLevels01R, fixLevels01SPSS, fixLevels01, hasDK, intToEnc, leveltestR, leveltestSPSS, removeAllDK