Learn R Programming

biogram (version 1.1)

position_ngrams: Position n-grams

Description

Tranforms a vector of positioned n-grams into a list of positions filled with unigrams appearing on them.

Usage

position_ngrams(ngrams)

Arguments

ngrams
a vector of positioned n-grams (as created by count_ngrams).

Value

  • a list of length equal to the number of unique positions present in n-grams. Each element of the list contains unigrams that are present on this position.

See Also

Change n-gram name to human-friendly form: decode_ngrams.

Validate n-gram structure: is_ngram.

Examples

Run this code
position_ngrams(c("2_1.1.2_0.1", "3_1.1.2_0.0", "3_2.2.2_0.0"))

Run the code above in your browser using DataLab