pioHdr: Print a header

Description Usage Arguments Value Examples

View source: R/pioHdr.R

Description

Print a header, plus some optional parameters.

A header is thought to be the first message of a complex function, or of a runtime load for a package etc. Compare to pioTit, the header does not have the surrounding symbols and imposes less separations on the output layout.

The function allows also to pass some named vector as extra parameters, which will be layed out using function pioStr.

Usage

1
pioHdr(..., toPrint = NULL, prefix = "")

Arguments

...

A list of parameters that will be concatenated to create the header.

toPrint

A named vector of arguments, that will be print in the format 'n=v' where 'n' is a name and 'v' a value using function pioStr.

prefix

A prefix for each one of the strings in 'toPrint', passed to pioStr.

Value

None

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# A simple header
pioHdr("My new cool tool")

# A header with also some parameters, if the parameters
# are not part of a named vector, automatic names are generated

x = 12345
y = TRUE
z = NA

pioHdr("My new cool function", toPrint = c(x, y, z))

# If names are available, they are used
params = c(x, y, z)
names(params) = c("Input = ", "Test = ", "Plot = ")

pioHdr("My new cool function", toPrint = params)

# Using extra formats
pioHdr("My new cool function", toPrint = params, prefix = '\t- ')

# Change colours -- blak text on orange background
colorscheme_orange_black()
pioHdr("My new cool function", toPrint = params)

caravagn/pio documentation built on June 21, 2020, 5:18 a.m.