valign {textutils}R Documentation

Vertically Align Strings

Description

Vertically align character vectors.

Usage

valign(s, align = "|", insert.at = "<>", replace = TRUE, fixed = TRUE)

Arguments

s

a character vector

align

a regular expression

insert.at

a regular expression

replace

logical

fixed

logical

Details

The function expands the elements of a character vector in such a way that the elements are vertically aligned, which can be handy when generating reports. See Examples.

Value

a character vector

Author(s)

Enrico Schumann

See Also

strwrap, format

Examples

s <- c("Player 1 <>| 100",
       "another player <>| 999999")

cat(paste(s, collapse = "\n"))
## Player 1 <>| 100
## another player <>| 999999

cat(paste(valign(s), collapse = "\n"))
## Player 1        100
## another player  999999


[Package textutils version 0.4-1 Index]