## ----setup, include = FALSE--------------------------------------------------- library(qlcMatrix) ## ----ttIntro------------------------------------------------------------------ data <- c("a", "b", "a", "c", "b", "c", "A") ttMatrix(data) ## ----ttSimplify--------------------------------------------------------------- options(qlcMatrix.locale = "en_US.UTF-8") ttMatrix(data, simplify = TRUE) options(qlcMatrix.locale = "C") ttMatrix(data, simplify = TRUE) ## ----pwIntro------------------------------------------------------------------ strings <- c("this", "is", "that") (PW <- pwMatrix(strings, sep = "", simplify = TRUE, gap.length = 1) ) ## ----pwUsage------------------------------------------------------------------ TT <- ttMatrix(rownames(PW), simplify = TRUE) printSpMatrix(TT, col.names = TRUE) (TT*1) %*% (PW*1) ## ----adjacency---------------------------------------------------------------- S <- bandSparse( n = ncol(TT), k = 1) (TT*1) %*% (S*1) %*% t(TT*1)