set_LDA_plot_colors: Prepare the colors to be used in the LDA plots

Description Usage Arguments Value Examples

View source: R/LDA_plots.R

Description

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

Usage

1
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

1
2
3
4
  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]])

weecology/LDATS documentation built on March 28, 2020, 11:20 a.m.