vignettes/utils_knitr.R

# Simple way to output code as-is to knitr
kat <- knitr::asis_output

# Function to wrap example code between ``` before katting
kat_code <- function(code, language="r") {
  result <- c(
      paste0("```",language, "\n"),
      code,
      "\n```")
  kat(result)
}

Try the zmisc package in your browser

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

zmisc documentation built on Aug. 22, 2023, 5:07 p.m.