set_gamma_colors: Prepare the colors to be used in the gamma time series

Description Usage Arguments Value Examples

View source: R/TS_plots.R

Description

Based on the inputs, create the set of colors to be used in the time series of the fitted gamma (topic proportion) values.

Usage

1
set_gamma_colors(x, cols = NULL, option = "D", alpha = 1)

Arguments

x

Object of class TS_fit, fit by TS.

cols

Colors to be used to plot the time series of fitted topic proportions.

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"), "viridis" (or "D", the default option) 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
5
6
7
8
9
  data(rodents)
  document_term_table <- rodents$document_term_table
  document_covariate_table <- rodents$document_covariate_table
  LDA_models <- LDA_set(document_term_table, topics = 2)[[1]]
  data <- document_covariate_table
  data$gamma <- LDA_models@gamma
  weights <- document_weights(document_term_table)
  TSmod <- TS(data, gamma ~ 1, nchangepoints = 1, "newmoon", weights)
  set_gamma_colors(TSmod)

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