inst/doc/transformingDataSparse.R

## ----setup, include = FALSE----------------------------------------------
library(qlcMatrix)

## ----ttIntro-------------------------------------------------------------
data <- c("a", "b", "a", "c", "b", "c", "A")
ttMatrix(data)

## ----ttSimplify----------------------------------------------------------
ttMatrix(data, simplify = TRUE, collation.locale = "en_US.UTF-8")

## ----pwIntro-------------------------------------------------------------
strings <- c("this", "is", "that")
(PW <- pwMatrix(strings, sep = "", simplify = TRUE, gap.length = 1, gap.symbol = "_") )

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

Try the qlcMatrix package in your browser

Any scripts or data that you put into this service are public.

qlcMatrix documentation built on May 2, 2019, 9:14 a.m.