set_LDA_plot_colors {LDATS}R Documentation

Prepare the colors to be used in the LDA plots

Description

Based on the inputs, create the set of colors to be used in the LDA plots made by plot.LDA_TS.

Usage

set_LDA_plot_colors(x, cols = NULL, option = "C", alpha = 0.8)

Arguments

x

Object of class LDA.

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.

Value

vector of character hex codes indicating colors to use.

Examples


  data(rodents)
  lda_data <- rodents$document_term_table
  r_LDA <- LDA_set(lda_data, topics = 4, nseeds = 10) 
  set_LDA_plot_colors(r_LDA[[1]])



[Package LDATS version 0.3.0 Index]