package_LDA_TS: Package the output of LDA_TS

Description Usage Arguments Value Examples

View source: R/LDA_TS.R

Description

Combine the objects returned by LDA_set, select_LDA, TS_on_LDA, and select_TS, name them as elements of the list, and set the class of the list as LDA_TS, for the return from LDA_TS.

Usage

1
package_LDA_TS(LDAs, sel_LDA, TSs, sel_TSs)

Arguments

LDAs

List (class: LDA_set) of LDA models (class: LDA), as returned by LDA_set.

sel_LDA

A reduced version of LDAs that only includes the LDA model(s) selected by select_LDA. Still should be of class LDA_set.

TSs

Class TS_on_LDA list of results from TS applied for each model on each LDA model input, as returned by TS_on_LDA.

sel_TSs

A reduced version of TSs (of class TS_fit) that only includes the TS model chosen via select_TS.

Value

Class LDA_TS-class object including all fitted models and selected models specifically, ready to be returned from LDA_TS.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
  data(rodents)
  data <- rodents
  control <- LDA_TS_control()              
  dtt <- data$document_term_table
  dct <- data$document_covariate_table
  weights <- document_weights(dtt)
  LDAs <- LDA_set(dtt, 2, 1, control$LDA_set_control)
  sel_LDA <- select_LDA(LDAs, control$LDA_set_control)
  TSs <- TS_on_LDA(sel_LDA, dct, ~1, 1, "newmoon", weights,  
                   control$TS_control)
  sel_TSs <- select_TS(TSs, control$TS_control)
  package_LDA_TS(LDAs, sel_LDA, TSs, sel_TSs)

 

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