Fit LDA-model with k topics.

fit_lda(
  df,
  k,
  stopwords = stopwords_miretrieve,
  method = "gibbs",
  control = NULL,
  seed = 42,
  col.abstract = Abstract,
  col.pmid = PMID
)

Arguments

df

Data frame containing abstracts and PubMed-IDs.

k

Integer. Number of topics to fit. Must be >=2.

stopwords

Data frame containing stop words.

method

String. Either "gibbs" or "VEM".

control

Control parameters for LDA modeling. For more information, see the documentation of the LDAcontrol class in the topicmodels package.

seed

Integer. Seed for reproducibility.

col.abstract

Column containing abstracts.

col.pmid

Column containing PubMed-ID.

Value

LDA-model.

Details

Fit LDA-model with k topics from a data frame. fit_lda() is based on LDA() from the package topicmodels.

See also