Learn R Programming

qdap (version 2.4.6)

outlier_detect: Detect Outliers in Text

Description

Locate possible outliers for text variables given numeric word function.

Usage

outlier_detect(
  text.var,
  grouping.var = NULL,
  FUN = word_count,
  scale.by = "grouping"
)

Value

Returns a dataframe with possible outliers.

Arguments

text.var

The text variable.

grouping.var

The grouping variables. Default NULL generates one word list for all text. Also takes a single grouping variable or a list of 1 or more grouping variables.

FUN

A word function with a numeric vector output (e.g., syllable_sum, character_count or word_count).

scale.by

A character string indicating which dimensions to scale by. One of "all", "grouping", or "both". Default NULL scales by all.

Examples

Run this code
if (FALSE) {
with(DATA, outlier_detect(state))
with(DATA, outlier_detect(state, FUN = character_count))
with(DATA, outlier_detect(state, person, FUN = character_count))
with(DATA, outlier_detect(state, list(sex, adult), FUN = character_count))
with(DATA, outlier_detect(state, FUN = syllable_sum))
htruncdf(with(raj, outlier_detect(dialogue, person)), 15, 45)
}   

Run the code above in your browser using DataLab