11 Base Object
11.1 Purpose
Provides a common interface for results regardless of what analysis is run.
11.1.1 Variables
analysisTitle - (string) Description of the analysis stored in the object, used for headers and titles in reports and displays
exportName - (string) Name used when generating file download names, no spaces or punctuation should be used
descriptionText - (string) Markdown text to be displayed in outputs prior to the output tables and figures
tableTitle- (list<string>) Title text to be used on object tables, each item in list corresponds to one table output in printTables
groupByVars - (string) Comma-separated string of variable name to use as grouping variables within the tables
surveys - (dataframe) Dataframe containing survey-level data
samples - (dataframe) Dataframe containing samples
results - (list<dataframes>) List of dataframes containing results of analysis
plots - (list<ggplot objects>) List of ggPlot objects created from analysis
errors - (list<string>) Error messages created during analysis
warnings- (list<string>) Warning messages created during analysis
groupHeaderBackgroundColor - (string) Color to be used in background of group header within table, groups are determined by the groupByVars variable, used in HTML outputs only
groupSummaryBackgroundColor - (string) Color to be used in the summary row of each group within table, groups are determined by the groupByVars variable, used in HTML outputs only
gtTheme - (string) Name of gt tables theme from the gtExtras package, used in HTML outputs only
11.1.2 Methods
print - method used by R to print the results variable
exportJson - method used to create and save Json file of results, no default implementation
exportCsv - method used to create and save Csv file of results, no default implementation
createTable - generic table to create both Latex and Html tables for object
createTableLatex - creates table formatted for Latex, default implementation simply calls and returns createTable
createTableHtml - creates table formatted for Html, default implementation simply calls and returns createTable
printTablesLatex - called to output all tables in a LaTex format, this does not include any formatting or table specific code which is included in the createTable? functions, but instead iterates through multiple table outputs
printTablesHtml - called to output all tables in a Html format, this does not include any formatting or table specific code which is included in the createTable? functions, but instead iterates through multiple table outputs
printTablesAuto - tests the incoming call for a LaTex environment and calls either printTablesLatex or printTablesHtml as appropiate, used for markdown reports that can be user-generated in mulitple formats
iterateSurvey - a generic function that crawls through two loops, one for survey groups, one for specific tables (one analysis may output mulitiple tables) and is called by the printTable functions
printPlots - called to output ggplot outputs stored as part of analysis
11.2 Overriding Base Object
The fc_base object can be extended and customized to produce objects for specific analysis. See details in “Creating Analyis Chapter”.