Learn R Programming

knitr (version 1.48)

knit_meta: Metadata about objects to be printed

Description

As an object is printed, knitr will collect metadata about it (if available). After knitting is done, all the metadata is accessible via this function. You can manually add metadata to the knitr session via knit_meta_add().

Usage

knit_meta(class = NULL, clean = TRUE)

knit_meta_add(meta, label = "")

Value

knit_meta() returns the matched metadata specified by

class; knit_meta_add() returns all current metadata.

Arguments

class

Optionally return only metadata entries that inherit from the specified class. The default, NULL, returns all entries.

clean

Whether to clean the collected metadata. By default, the metadata stored in knitr is cleaned up once retrieved, because we may not want the metadata to be passed to the next knit() call; to be defensive (i.e. not to have carryover metadata), you can call knit_meta() before knit().

meta

A metadata object to be added to the session.

label

A chunk label to indicate which chunk the metadata belongs to.