get_ngrams_ind: Get indices of n-grams

Description Usage Arguments Details Value Examples

View source: R/indices_and_positions.R

Description

Computes list of n-gram elements positions in sequence.

Usage

1
get_ngrams_ind(len_seq, n, d)

Arguments

len_seq

integer value describing sequence's length.

n

integer size of n-gram.

d

integer vector of distances between elements of n-gram (0 means consecutive elements). See Details.

Details

A format of d vector is discussed in Details of count_ngrams.

Value

A list with number of elements equal to n. Every element is a vector containing locations of given n-gram letter. For example, first element of list contain indices of first letter of all n-grams. The attribute d of output contains distances between letter used to compute locations (see Details).

Examples

1
2
# positions trigrams in sequence of length 10
get_ngrams_ind(10, 9, 0)

biogram documentation built on March 31, 2020, 5:14 p.m.