qgrams('hello world',q=3)
# q-grams are counted uniquely over a character vector
qgrams(rep('hello world',2),q=3)
# to count them separately, do something like
x <- c('hello', 'world')
lapply(x,qgrams, q=3)
Run the code above in your browser using DataLab