CodeChunk: A executable chunk of code.

Description Usage Arguments Value See Also Examples

View source: R/types.R

Description

A executable chunk of code.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
CodeChunk(
  text,
  alters,
  assigns,
  caption,
  declares,
  duration,
  errors,
  exportFrom,
  format,
  id,
  importTo,
  imports,
  label,
  meta,
  outputs,
  programmingLanguage,
  reads,
  uses
)

Arguments

text

The text of the code. Required.

alters

Names of variables that the code chunk alters.

assigns

Variables that the code chunk assigns to.

caption

A caption for the CodeChunk.

declares

Variables that the code chunk declares.

duration

Duration in seconds of the last execution of the chunk.

errors

Errors when compiling or executing the chunk.

exportFrom

A compilation directive giving the name of the variable to export into the content of the code block.

format

Media type, typically expressed using a MIME format, of the code.

id

The identifier for this item.

importTo

A compilation directive giving the name of the variable to import the content of the code block as.

imports

Software packages that the code chunk imports

label

A short label for the CodeChunk.

meta

Metadata associated with this item.

outputs

Outputs from executing the chunk.

programmingLanguage

The programming language of the code.

reads

Filesystem paths that this code chunk reads from.

uses

Names of variables that the code chunk uses (but does not alter).

Value

A list of class CodeChunk

See Also

CodeBlock

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
CodeChunk(
  programmingLanguage = "r",
  text = "plot(1)",
  label = "Figure 1",
  id = "fig1",
  caption = list(
    Heading(
      content = list("Figure title"),
      depth = 2
    ),
    Paragraph(
      content = list(
        "A paragraph with some",
        Strong(content = list("strong emphasis")),
        "in it."
      )
    )
  )
)

stencilaschema documentation built on Feb. 22, 2021, 5:05 p.m.