R/print_lm_list.R

Defines functions print.lm_list

Documented in print.lm_list

#' @title Print an `lm_list`-Class
#' Object
#'
#' @description Print the content of the
#' output of [lm2list()].
#'
#' @return `x` is returned invisibly.
#' Called for its side effect.
#'
#' @param x The output of [lm2list()].
#'
#' @param ...  Other arguments. Not
#' used.
#'
#'
#'
#' @examples
#'
#' data(data_serial_parallel)
#' lm_m11 <- lm(m11 ~ x + c1 + c2, data_serial_parallel)
#' lm_m12 <- lm(m12 ~ m11 + x + c1 + c2, data_serial_parallel)
#' lm_m2 <- lm(m2 ~ x + c1 + c2, data_serial_parallel)
#' lm_y <- lm(y ~ m11 + m12 + m2 + x + c1 + c2, data_serial_parallel)
#' # Join them to form a lm_list-class object
#' lm_serial_parallel <- lm2list(lm_m11, lm_m12, lm_m2, lm_y)
#' lm_serial_parallel
#'
#' @export

print.lm_list <- function(x, ...) {
    cat("\nThe model(s):\n")
    lapply(x, function(y) print(y$call$formula))
    cat("\n")
    invisible(x)
  }

Try the manymome package in your browser

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

manymome documentation built on Oct. 4, 2024, 5:10 p.m.