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

View source: R/cleandata.R

remove_dont_knowR Documentation

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

remove_dont_know(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(), fix_common_encoding_problems(), fix_levels_01_spss(), has_dont_know(), intToEnc(), leveltest, remove_all_dont_know()


andrie/surveydata documentation built on March 13, 2023, 2 a.m.