rprintv: Build a character vector or list with variable-based string...

Description Usage Arguments Examples

View source: R/rprintv.R

Description

The rprintv function applies variable-based formatter to transform the given character vector to specific texts with named variables replaced by a given set of values in correct formats.

Usage

1
rprintv(.format, ..., .envir = parent.frame())

Arguments

.format

The character vector or list to be transformed

...

The arguments that specify the set of values to be placed

.envir

The environment in which variables are searched if not explictly specified. Use emptyenv() to disable this behavior. This feature only works for variable-name formatting.

Examples

1
2
3
4
5
6
7
8
9
## Not run: 

# Format a single-entry character vector with variable mechanism
rprintf('Hello, $name', name='world')
rprintf('$name ($age years old)',name='Ken',age=24)
rprintf('He is $age but has a height of $height:.2fcm',age=18,height=190)
rprintf('$a, $b:.1f, $c:+.2f, $b, $a:.0f',a=1.56,b=2.34,c=3.78)

## End(Not run)

renkun-ken/rprintf documentation built on May 27, 2019, 5:50 a.m.