centerText(x, width = getOption("width"))
getOption("width")
.strwrap
cat(centerText("One Line Test"), "")
mText <-c("This", "is an example",
"of a multiline text ",
"with ",
"leading",
"and trailing ",
"spaces.")
cat("", centerText(mText), "", sep="")
Run the code above in your browser using DataLab