justify {mathgraph}R Documentation

Justify Elements of a Vector

Description

Returns a vector like the input, but each string may have added blank spaces at the start and/or end.

Usage

justify(x, type = "r")

Arguments

x a character vector.
type a string giving the type of justification.
This may be an abbreviation of one of "right", "left", "center".

Value

a character vector like x, except all elements have the same number of characters, and the text is lined up along one edge, or centered.

Author(s)

Nick Efthymiou

References

S Poetry, Patrick J. Burns

See Also

format, substring, paste

Examples

data(freeny)
as.matrix(justify(dimnames(freeny.x)[[2]], "r"))
as.matrix(justify(dimnames(freeny.x)[[2]], "l"))
as.matrix(justify(dimnames(freeny.x)[[2]], "c"))

[Package mathgraph version 0.9-8 Index]