#------------------------------------------------------------------------------#
# PrintHeadings #
#------------------------------------------------------------------------------#
#' printHeading
#'
#' \code{printHeading} Prints a three line heading with text centered on 2nd line
#' @export
printHeading <- function(text, symbol = "=", newlines = 1) {
leftPad <- max(38 - floor(nchar(text)/2), 0)
rightPad <- max(80 - leftPad - nchar(text) - 2, 8, 0)
cat(rep("\n", newlines))
cat(paste0("#", strrep(symbol, 78), "#", collapse = ""))
cat(paste0("\n#", strrep(" ", leftPad), text,
strrep(" ", rightPad) , "#", collapse = ""))
cat(paste0("\n#", strrep(symbol, 78), "#", collapse = ""),"\n")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.