knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

tst - Timestamped Suffix Trees

lifecycle AppVeyor build status Travis build status Coverage status

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.

Installation

install.packages("devtools") # if you don't have devtools already installed
devtools::install_github("pmcharrison/tst")

Example use

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"))


pmcharrison/tst documentation built on May 24, 2019, 7:36 a.m.