#' LaTeX Table Title Maker
#'
#' @param analysis Analysis that produced data for regression analyses: "cfa", "bf", or "lca"
#' @param model Which model (numerically) out of the list of models? Pulls predictors from modelPredictorNamesList
#' @param outcomeVar Outcome variable name
#'
#' @return
#' @export
titleR <- function(analysis, model, outcomeVar) {
require(Hmisc)
modelName <- Hmisc::capitalize(model)
# ------------------------------------------------- #
# ------------------------------------------------- #
##### Place to put rules for changing model names (other than capitalization) ####
if (model == 'dysphoricarousal') {
modelName <- gsub(model, pattern = 'dysphoricarousal', replacement = 'Dysphoric Arousal')
}
# ------------------------------------------------- #
# ------------------------------------------------- #
outcomeName <- outcomeNameVector[outcomeVar]
if (analysis == 'bcfa') caption <- paste0('Summary of Analyses with ', outcomeName, ' and the ', modelName, ' BCFA Model', '.')
if (analysis == 'cfa') caption <- paste0('Summary of Analyses with ', outcomeName, ' and the ', modelName, ' CFA Model', '.')
if (analysis == 'bf') caption <- paste0('Summary of Analyses with ', outcomeName, ' and the ', modelName, ' Bifactor Model', '.')
if (grepl(pattern = 'lca', x = analysis) == TRUE) {
classes <- gsub(pattern = 'lca', x = analysis, replacement = '')
caption <- paste0('Summary of Analyses with ', outcomeName, ' and the ', classes, '-Class LCA', '.')
}
return(caption)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.