% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tmfast.R
\name{insert_topics}
\alias{insert_topics}
\title{Insert a topic model into a fitted \code{tmfast}}
\usage{
insert_topics(fitted, k, x = NULL)
}
\arguments{
\item{fitted}{Fitted \code{tmfast} object}

\item{k}{Desired number of topics for new model}

\item{x}{Data matrix (document-term matrix), as Matrix object (eg, using \code{build_matrix()})}
}
\value{
\code{tmfast} object, as \code{fitted}, with additional topic model inserted
}
\description{
Apply varimax rotation for a value of k less than the maximum already included in the tmfast.
}
\examples{
\donttest{
set.seed(42)
theta  = rdirichlet(50, 1, k = 4)
phi    = rdirichlet(4, 0.1, k = 20)
corpus = draw_corpus(rep(50L, 50), theta, phi)
model  = tmfast(corpus, n = c(3, 4))
insert_topics(model, k = 2)
}
}
