figr: Code Chunk Reference

Description Usage Arguments Value Examples

Description

Reference a code chunk.

Usage

1
figr(label, prefix, link, type)

Arguments

label

The code chunk label.

prefix

Logical: return the prefix (chunk type) along with the rank.

link

### Logical: Place an HTML link to the anchor?

type

The type of the referenced chunk.

Value

A text or url reference to the code chunk.

Examples

1
2
3
4
5
6
7
8
figr("test", type="reference")
figr("test")
figr("test", TRUE, link=FALSE)
if(interactive()){
  require(knitr)
  opts_knit$set(kfigr.prefix=TRUE, kfigr.link=TRUE)
  figr("test")
}

Example output

knitr hook "anchor" is now available
[1] "<a href=\"#test\">1</a>"
[1] "<a href=\"#test\">1</a>"
[1] "reference 1"

kfigr documentation built on May 2, 2019, 3:21 p.m.