makecodechunk: makecodechunk

View source: R/reptools.r

makecodechunkR Documentation

makecodechunk

Description

Create Text for Running Code Chunk

Usage

makecodechunk(
  cmd,
  opts = NULL,
  results = "asis",
  lang = "r",
  callout = NULL,
  h = NULL,
  w = NULL
)

Arguments

cmd

character string vector of commands to run inside chunk

opts

optional list of chunk options, e.g. list(fig.width=6, fig.cap="This is a caption"). See https://yihui.org/knitr/options/ for a complete list of options.

results

format of results, default is 'asis'. May specify results='markup'.

lang

language for the chunk

callout

an optional Quarto callout to include after ⁠#|⁠ after the chunk header that affects how the result appears, e.g. callout='column: margin'

h

optional height to place after the chunk header after ⁠#|⁠

w

optional width

Details

Creates text strings suitable for running through knitr. The chunk is given a random name because certain operations are not allowed by knitr without it.

Value

character vector

Author(s)

Frank Harrell

Examples

makecodechunk('x <- pi; print(x)')

qreport documentation built on May 29, 2024, 3:51 a.m.