rapport.example: Template Examples

Description Usage Arguments Examples

View source: R/template.R

Description

Displays template examples defined in Example section. Handy to check out what template does and how does it look like once it's rendered. If multiple examples are available, and index argument is NULL, you will be prompted for input. If only one example is available in the header, user is not prompted for input action, and given template is evaluated automatically. At any time you can provide an integer vector with example indices to index argument, and specified examples will be evaluated without prompting, thus returning a list of rapport objects. Example output can be easily exported to various formats (HTML, ODT, etc.) - check out documentation for rapport.export for more info.

Usage

1
rapport.example(fp, index = NULL, env = .GlobalEnv)

Arguments

fp

a template file pointer (see rapport:::rapport.read for details)

index

a numeric vector indicating the example index - meaningful only for templates with multiple examples. Accepts vector of integers to match IDs of template example. Using 'all' (character string) as index will return all examples.

env

an environment where example will be evaluated (defaults to .GlobalEnv)

Examples

1
2
3
4
5
6
7
8
## Not run: 
rapport.example('Example')
rapport.example('Example', 1:2)
rapport.example('Example', 'all')
rapport.example('Crosstable')
rapport.export(rapport.example('Crosstable'))

## End(Not run)

rapport documentation built on April 12, 2021, 1:06 a.m.