maketabs {qreport}R Documentation

maketabs

Description

Make Quarto Tabs

Usage

maketabs(
  ...,
  wide = FALSE,
  cwidth = if (wide) "column-page",
  initblank = FALSE,
  baselabel = NULL,
  cap = NULL,
  basecap = NULL,
  debug = FALSE
)

Arguments

...

a series of formulas or a single named list. For formulas the left side is the tab label (if multiple words or other illegal R expressions enclose in backticks) and the right hand side has expressions to evaluate during chunk execution, plus optional raw, caption, and fig.size options.

wide

set to TRUE to use a Quarto column-page for the body of the text to allow it to use some of the margins

cwidth

specify a legal Quarto character string instead of wide to specify the width of the output. These are defined here. Commonly used values are 'column-screen-right', 'column-page-left', 'column-screen-inset-shaded'.

initblank

set to TRUE to create a first tab that is blank so that the report will not initially show any tabbed material

baselabel

a one-word character string that provides the base name of labels for tabs with figure captions. The sequential tab number is appended to baselabel to obtain the full figure label. If using formulas the figure label may instead come from caption(.., label). If not specified it is taken to be the name of the current chunk with ⁠fig-⁠ prepended.

cap

applies to the non-formula use of maketabs and is an integer vector specifying which tabs are to be given figure labels and captions.

basecap

a single character string providing the base text for captions if cap is specified.

debug

set to TRUE to output debugging information in file ⁠/tmp/z⁠

Details

Loops through a series of formulas or elements of a named list and outputs each element into a separate Quarto tab. wide and column arguments are used to expand the width of the output outside the usual margins. An initblank argument creates a first tab that is empty, or you can specify a formula ⁠ ⁠ ~ ⁠ ⁠. This allows one to show nothing until one of the other tabs is clicked. Multiple commands can be run in one chunk by including multiple right hand terms in a formula. A chunk can be marked for producing raw output by including a term raw somewhere in the formula's right side. If can be marked for constructing a label and caption by including ⁠+ caption(caption string, label string)⁠. The tab number is appended to the label string, and if the label is not provided baselabel will be used.

Value

nothing is returned; used to render markup

Author(s)

Frank Harrell

Examples

X <- list(A=data.frame(x=1:2), B=data.frame(x=1:2, y=11:12))
maketabs(X)

[Package qreport version 1.0-0 Index]