Generate ngrams

Usage

ngrams(text.var, grouping.var = NULL, n = 2, ...)

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.
n
The max number of grams calculate
...
Further arguments passed to strip function.

Generate ngrams

Value

Returns a list of: rawA list of pasted single vectors of the ngrams per row. groupA list of pasted vectors of ngrams grouped by grouping.var. unlist1A list of a single vector of pasted ngrams per grouping.var in the order used. unlist2A list of a single vector of pasted ngrams per grouping.var in alphabetical order. group_nA list of a list of vectors of ngrams per grouping.var & n (not pasted). allA single vector of pasted ngrams sorted alphabetically. all_nA list of lists a single vectors of ngrams sorted alphabetically (not pasted).

Description

Transcript apply ngrams.

Examples

## <strong>Not run</strong>: # ngrams(DATA$state, DATA$person, 2) # ngrams(DATA$state, DATA$person, 3) # ngrams(DATA$state, , 3) # with(mraja1, ngrams(dialogue, list(sex, fam.aff), 3)) # ## <strong>End(Not run)</strong>