FormatText: Compose text strings conditional on values of an object.

Description Usage Arguments Details Value Examples

View source: R/utils_strings.R

Description

Compose text strings conditional on values of an object.

Usage

1
FormatText(x, ..., quote = "'")

Arguments

x

an integer-valued numeric scalar or a logical vector. In the former case, indicates a number of items; in the latter case, indicates which items in a vector were affected. May have the 'names' attribute set.

...

one or more character vectors that are pasted together (collapsed) after concatenating the vectors one after another.

quote

the quote character to use.

Details

The function replaces the following special character patterns:

Exception: These four patterns output only up to the Kth item, where K = getOption('FormatTextMaxOutput', default=7L).

Value

A character string.

Examples

1
2
3
4
## Not run: 
  FormatText(n, "There {is|are} {no|one|$N} item{|s}.")
  FormatText(is.na(x), "Found $N NAs ($P% of all $L) in rows $w")
## End(Not run)

google/GeoexperimentsResearch documentation built on May 17, 2019, 7:42 a.m.