potential_NA: Search for Potential Missing Values

Description Usage Arguments Value Examples

Description

Search for potential missing values (i.e. sentences that are merely a punctuation mark) and optionally replace with missing value (NA). Useful in the initial cleaning process.

Usage

1
  potential_NA(text.var, n = 3)

Arguments

text.var

The text variable.

n

Number of characters to consider for missing (default is 3).

Value

Returns a dataframe of potential missing values row numbers and text.

Examples

1
2
3
4
5
6
7
DATA$state[c(3, 7)] <- "."
potential_NA(DATA$state, 20)
potential_NA(DATA$state)
# USE TO SELCTIVELY REPLACE CELLS WITH MISSING VALUES
DATA$state[potential_NA(DATA$state, 20)$row[-c(3)]] <- NA
DATA
DATA <- qdap::DATA

trinker/qdap2 documentation built on May 31, 2019, 9:47 p.m.