knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
tst
is an R package for building timestamped suffix trees (TSTs).
TSTs are suffix trees
that store timestamps for each state transition in the training sequence(s).
Given a sequence of consecutive symbols, the TST can efficiently return
the timepoints when this sequence occurred in the training data,
the symbols that followed this sequence in the training data,
and the timepoints when these continuation symbols were observed.
install.packages("devtools") # if you don't have devtools already installed devtools::install_github("pmcharrison/tst")
library(tst) # Build and visualize a simple suffix tree t <- new_tree() add_seq(t, c("a", "b", "c", "a", "b")) plot(t) # Incrementally visualize the building of a suffix tree t <- new_tree() add_seq(t, c("a", "b", "c", "a", "b"), visual = TRUE) # Search for n-grams when_ngram(t, c("a", "b")) count_ngram(t, c("a", "b"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.