export_browser_topic_words: Export topic-word file for dfr-browser

export_browser_topic_wordsR Documentation

Export topic-word file for dfr-browser

Description

Exports the tw.json representation of the topic-word matrix as used by dfr-browser. Use this to customize the output (e.g. by changing the weighting of words in topics).

Usage

export_browser_topic_words(
  file,
  keys,
  alpha,
  digits = 4,
  overwrite,
  index,
  permute
)

Arguments

file

output file name

keys

data frame with topic, word, weight columns and n rows for each topic (as in the result of top_words

alpha

vector of topic hyperparameters a. The number of topics K is guessed from the length of this vector, so even if the alpha parameter is not meaningful, supply a vector of zeroes of length equal to K.

digits

numerical rounding (passed on to toJSON)

overwrite

clobber existing file?

index

if non-NULL, output is assumed to go into an element with ID m__DATA__tw in an HTML file at this path. file is ignored.

permute

if non-NULL, exported topic k will correspond to the topic numbered permute[k] in the data

See Also

export_browser_data for a more automated export of all model information at once


agoldst/dfrtopics documentation built on July 15, 2022, 4:13 p.m.