Hi: I am trying to compute n-grams using package tm and tau with following code: tokenize_ngrams <- function(x, n=3) return(rownames(as.data.frame(unclass(textcnt(x,method="string",n=n))))) texts <- c("This is the first document.", "This is the second file.", "This is the third text.") corpus <- Corpus(VectorSource(texts)) matrix <- DocumentTermMatrix(corpus,control=list(tokenize=tokenize_ngrams)) And getting following error Error in FUN(X[[2L]], ...) : non-character argument also getting same error using the RTextTools package. Any solution? Best regards: John