Learn R Programming

surveydata (version 0.2.7)

remove_all_dont_know: Removes "Do not know" and other similar words from factor levels in data frame.

Description

Removes "Do not know" and other similar words from factor levels in data frame

Usage

remove_all_dont_know(x, dk = NULL, message = TRUE)

Value

A data frame

Arguments

x

List or data frame

dk

Character vector, containing search terms, e.g. c("Do not know", "DK"). These terms will be replaced by NA. If NULL, defaults to c("I don't know", "Don't Know", "Don't know", "Dont know" , "DK")

message

If TRUE, displays message with the number of instances that were removed.

See Also

hasDK() and removeDK()

Other Functions to clean data: encToInt(), fix_common_encoding_problems(), fix_levels_01_spss(), has_dont_know(), intToEnc(), leveltest, remove_dont_know()