import(Matrix)
importFrom(matrixStats, logSumExp, rowLogSumExps, colLogSumExps)
importFrom(slam, tcrossprod_simple_triplet_matrix, simple_triplet_matrix, as.simple_triplet_matrix)
importFrom(splines, ns,bs)
importFrom(lda, lda.collapsed.gibbs.sampler)
importFrom(stringr,str_wrap, str_split, str_detect, str_replace, str_replace_all)
importFrom(glmnet, glmnet, cv.glmnet)
importFrom(Rcpp, evalCpp)
importFrom(grDevices, rainbow, rgb)
importFrom(graphics, abline, axis, hist, legend, lines, par, plot, points, segments, smoothScatter, text, title)
importFrom(stats, aggregate, as.formula, coef, cor, cov, lm, loess, median, model.frame, model.response, model.matrix, na.omit, optim, optimize, pchisq, predict, quantile, rbinom, rgamma, rnorm, runif, terms)
importFrom(utils, packageVersion)

export(stm, summary.STM, print.STM, plot.STM,
       estimateEffect, plot.estimateEffect, 
       topicCorr, plot.topicCorr,
       labelTopics, print.labelTopics,
       findThoughts, print.findThoughts, plot.findThoughts, plotQuote,
       convertCorpus,
       manyTopics, selectModel, plotModels, plotTopicLoess, 
       prepDocuments, readCorpus, writeLdac, textProcessor, print.textProcessor,
       summary.textProcessor, head.textProcessor, findTopic,
	topicQuality, s, 
      permutationTest, plot.STMpermute, cloud, sageLabels, print.sageLabels,
      multiSTM, print.MultimodDiagnostic, plot.MultimodDiagnostic,
  checkBeta, make.heldout, eval.heldout, checkResiduals,
  searchK, plot.searchK, plotRemoved, thetaPosterior, topicLasso,
	toLDAvis)

S3method(summary, STM)
S3method(print, STM)
S3method(plot, STM)
S3method(print, labelTopics)
S3method(plot, topicCorr)
S3method(plot, estimateEffect)
S3method(print, findThoughts)
S3method(plot, findThoughts)
S3method(plot, STMpermute)
S3method(print, sageLabels)
S3method(print, MultimodDiagnostic)
S3method(plot, MultimodDiagnostic)
S3method(plot, searchK)
S3method(print, textProcessor)
S3method(summary, textProcessor)
S3method(head, textProcessor)


useDynLib(stm)