Learn R Programming

biogram (version 1.6.3)

degenerate_ngrams: Degenerate n-grams

Description

'Degenerates' n-grams by aggregating amino acid or nucleotide elements into bigger groups.

Usage

degenerate_ngrams(x, element_groups, binarize = FALSE)

Arguments

x

object containing n-grams.

element_groups

encoding of elements: list of groups to which elements of n-grams should be aggregated. Must have unique names.

binarize

logical indicating if n-grams should be binarized

Value

A character vector or matrix (if input is a matrix) containing degenerated n-grams.