R/print_helpers.R

Defines functions header_str

#' @noRd
header_str <- function(x,
                       hw = .8,
                       sym = "=",
                       min = 2,
                       prefix = character(0),
                       suffix = character(0),
                       sep_i = " ") {
  full_w <- options("width")$width
  hw1 <- floor(full_w * hw)
  x_len <- nchar(x)
  a <- floor((hw1 - x_len - 2) / 2)
  a <- max(min, a)
  out <- paste0(prefix,
                strrep(sym, a),
                sep_i, x, sep_i,
                strrep(sym, a),
                suffix)
  out
}

Try the power4mome package in your browser

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

power4mome documentation built on Sept. 9, 2025, 5:35 p.m.