ldavis_save: Save Visualisation

Description Usage Arguments Value Examples

Description

Save Latent Dirichlet Allocation visualisation.

Usage

1
2
3
save_ldavis_html(prepared_vis, file, ...)

save_ldavis_json(prepared_vis, file)

Arguments

prepared_vis

Prepapred vis as returned by ldavis.

file

A file name to save the html or json.

...

Additional arguments from the official documentation.

Value

Invisibly returns file.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
docs <- prepare_documents(corpus)
dict <- corpora_dictionary(docs)
corpora <- doc2bow(dict, docs)

# lda model
model <- model_lda(
  corpus = corpora, 
  id2word = dict, 
  iterations = 50L, 
  num_topics = 2L
)

# visualise
vis <- prepare_ldavis(model, corpora, dict)
## Not run: save_ldavis_html(vis, "lda.html")

news-r/gensimr documentation built on Jan. 9, 2021, 5:55 a.m.