Description Usage Arguments Value
View source: R/getngramweights.R
Tabulates weights for all possible ngrams of a given order.
1 2  get_n_gram_weights(mod, order, pos = 1L, time = 0,
zero_indexed = FALSE)

mod 
A PPM model object as produced by (for example)

order 
(Integerish scalar) The order (i.e. number of symbols) of the ngrams to retrieve. 
pos 
(Integerish scalar) The nominal 'position' at which the ngram counts are retrieved (only relevant for decaybased models). 
time 
(Numeric scalar) The nominal 'time' at which the ngrams are retrieved (only relevant for decaybased models). 
zero_indexed 
(Logical scalar) Whether the ngrams should be presented as zeroindexed (as opposed to oneindexed) integer vectors. 
Returns a tibble
where each row corresponds to an ngram.
These ngrams are exhaustively enumerated from all possible symbols drawn from the model's alphabet.
The tibble contains n columns elt_1
, elt_1
, ... elt_n
,
corresponding to the n symbols in the ngram,
and a column weight
, identifying the weight of the specified ngram.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.