plot.LDA_VEM {LDATS}R Documentation

Plot the results of an LDATS LDA model

Description

Create an LDATS LDA summary plot, with a top panel showing the topic proportions for each word and a bottom panel showing the topic proportions of each document/over time. The plot function is defined for class LDA_VEM specifically (see LDA).

LDA_plot_top_panel creates an LDATS LDA summary plot top panel showing the topic proportions word-by-word.

LDA_plot_bottom_panel creates an LDATS LDA summary plot bottom panel showing the topic proportions over time/documents.

Usage

## S3 method for class 'LDA_VEM'
plot(
  x,
  ...,
  xtime = NULL,
  xname = NULL,
  cols = NULL,
  option = "C",
  alpha = 0.8,
  LDATS = FALSE
)

LDA_plot_top_panel(
  x,
  cols = NULL,
  option = "C",
  alpha = 0.8,
  together = FALSE,
  LDATS = FALSE
)

LDA_plot_bottom_panel(
  x,
  xtime = NULL,
  xname = NULL,
  cols = NULL,
  option = "C",
  alpha = 0.8,
  together = FALSE,
  LDATS = FALSE
)

Arguments

x

Object of class LDA_VEM.

...

Not used, retained for alignment with base function.

xtime

Optional x values used to plot the topic proportions according to a specific time value (rather than simply the order of observations).

xname

Optional name for the x values used in plotting the topic proportions (otherwise defaults to "Document").

cols

Colors to be used to plot the topics. Any valid color values (e.g., see colors, rgb) can be input as with a standard plot. The default (cols = NULL) triggers use of viridis color options (see option).

option

A character string indicating the color option from viridis to use if 'cols == NULL'. Four options are available: "magma" (or "A"), "inferno" (or "B"), "plasma" (or "C", the default option), "viridis" (or "D") and "cividis" (or "E").

alpha

Numeric value [0,1] that indicates the transparency of the colors used. Supported only on some devices, see rgb.

LDATS

logical indicating if the LDA plot is part of a larger LDATS plot output.

together

logical indicating if the subplots are part of a larger LDA plot output.

Value

NULL.

Examples


  data(rodents)
  lda_data <- rodents$document_term_table
  r_LDA <- LDA_set(lda_data, topics = 4, nseeds = 10) 
  best_lda <- select_LDA(r_LDA)[[1]]
  plot(best_lda, option = "cividis")
  LDA_plot_top_panel(best_lda, option = "cividis")
  LDA_plot_bottom_panel(best_lda, option = "cividis")



[Package LDATS version 0.3.0 Index]