Learn R Programming

rapport (version 0.3)

tpl.meta: Header Metadata

Description

Displays summary of template metadata stored in a header section. This part of template header consists of several key: value pairs, which define some basic template info, such as Title, Example, Strict, etc. If you're familiar with package development in R, you'll probably find this approach very similar to DESCRIPTION file.

Usage

tpl.meta(fp, fields = NULL, use.header = FALSE,
    trim.white = TRUE)

Arguments

fp
a template file pointer (see tpl.find for details)
fields
a list of named lists containing key-value pairs of field titles and corresponding regexes
use.header
a logical value indicating if the character vector provided in fp argument contains header data
trim.white
a logical value indicating if the extra spaces should removed from header fields before extraction

Value

  • a list with template metadata

Details

Mandatory Fields

The following fields must be specified in the template header and their size limits must be taken into account:

  • Title- a template title (at most 500 characters)
  • Author- author's (nick)name (at most 100 characters)
  • Description- template description (at most 5000 characters)

Optional Fields

Some fields are not required by the template. However, you should reconsider including them in the template, so that the other users could get a better impression of what your template does. These are currently supported fields:

  • Email- author's email address (defaults toNULL)
  • Packages- a comma-separated list of packages required by the template (defaults toNA)
  • Data required- is dataset required by a template? Field acceptsTRUEorFALSE, and defaults toFALSE.
  • Example- newline-separated example calls torapportfunction, including template data and inputs (defaults toNULL)
  • Strict- "strict mode" returns only the last warning from a chunk. Field acceptsTRUEorFALSE, and defaults toFALSE.

Upon successful execution, rp.meta-class object is returned invisibly.