Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

seq_qgrams

Get a table of qgram counts for integer sequences


Description

Get a table of qgram counts for integer sequences

Usage

seq_qgrams(..., .list = NULL, q = 1L)

Arguments

...

Any number of (named) arguments that will be coerced with as.integer

.list

Will be concatenated with the ... argument(s). Useful for adding integer vectors named 'q'.

q

The size of q-gramming.

Value

A matrix containing q-gram profiles. Columns 1 to q contain the encountered q-grams. The ensuing (named) columns contain the q-gram counts per vector. Run the example for a simple overview.

Missing values in integer sequences are treated as any other number.

See Also

Examples

# compare the 2-gram overlap between sequences 1:3 and 2:4
seq_qgrams(x = 1:3, y=2:4,q=2)

# behavior when NA's are present.
seq_qgrams(1:3,c(1,NA,2),NA_integer_)

stringdist

Approximate String Matching, Fuzzy Text Search, and String Distance Functions

v0.9.6.3
GPL-3
Authors
Mark van der Loo [aut, cre] (<https://orcid.org/0000-0002-9807-4686>), Jan van der Laan [ctb], R Core Team [ctb], Nick Logan [ctb], Chris Muir [ctb], Johannes Gruber [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.