https://github.com/cran/pracma
Tip revision: 6b5162225f1e90f742ac53c32bf06c8053cff577 authored by HwB on 26 July 2011, 00:00:00 UTC
version 0.7.5
version 0.7.5
Tip revision: 6b51622
strjust.Rd
\name{strjust}
\alias{strjust}
\title{
Justify character vector
}
\description{
Justify the strings in a character vector.
}
\usage{
strjust(s, justify = c("left", "right", "center"))
}
\arguments{
\item{s}{Character vector.}
\item{justify}{Whether to justify left, right, or centered.}
}
\details{
\code{strjust(s)} or \code{strjust(s, justify = ``right'')} returns
a right-justified character vector. All strings have the same length,
the length of the longest string in \code{s} --- but the strings in
\code{s} have been trimmed before.
\code{strjust(s, justify = ``left'')} does the same, with all strings
left-justified.
\code{strjust(s, justify = ``centered'')} returns all string in \code{s}
centered. If an odd number of blanks has to be added, one blank more is
added to the left than to the right.
}
\value{
A character vector of the same length.
}
\seealso{
\code{\link{strtrim}}
}
\examples{
S <- c("abc", "letters", "1", "2 2")
strjust(S, "left")
}
\keyword{ string }