Learn R Programming

rock (version 0.8.1)

heading: Print a heading

Description

This is just a convenience function to print a markdown or HTML heading at a given 'depth'.

Usage

heading(
  ...,
  headingLevel = rock::opts$get("defaultHeadingLevel"),
  output = "markdown",
  cat = TRUE
)

Value

The heading, invisibly.

Arguments

...

The heading text: pasted together with no separator.

headingLevel

The level of the heading; the default can be set with e.g. rock::opts$set(defaultHeadingLevel=1).

output

Whether to output to HTML ("html") or markdown (anything else).

cat

Whether to cat (print) the heading or just invisibly return it.

Examples

Run this code
heading("Hello ", "World", headingLevel=5);
### This produces: "\n\n##### Hello World\n\n"

Run the code above in your browser using DataLab