R/list_model_classes.R

Defines functions list_model_classes

Documented in list_model_classes

#' @title list_model_classes
#'
#' @description Returns the possible model classes that `gglm` works with.
#'
#' @param ... Currently ignored. For extendability.
#' @note Note that these are not always the exact name of the class that that 
#' can be used. This is due to how some methods are written in the packages
#' `gglm` imports. For example, the model class "merMod" refers to a variety of
#' model outputs from `lme4`, even when the outputted class is not called 
#' "merMod". 
#' @return A character vector containing the possible model classes that `gglm`
#' works with.
#' @examples
#' list_model_classes()
#' @export

list_model_classes <- function(...) {
  ns <- getNamespace("gglm")
  model_classes <- c()
  for (i in names(ns)) {
    if (startsWith(i, "fortify.")) {
      class <- gsub("fortify.", "", i)
      model_classes <- c(model_classes, class)
    }
  }
  return(model_classes)
}

Try the gglm package in your browser

Any scripts or data that you put into this service are public.

gglm documentation built on March 31, 2023, 5:45 p.m.