
150 R Programming for Bioinformatics
and we have produced yet another one that is designed to interact with the
Sweave system. Two builtin functions are strtrim, which trims strings to a
fixed width, and strwrap, which introduces line breaks into a text string.
To trim strings to fit into a particular width, say for text display, use
strtrim. The arguments to strtrim are the character vector and a vector
of widths. The widths are interpreted as the desired width in a monospaced
font. To wrap text use strwrap, which honors a number of arguments including
the width, indentation, and a user-supplied prefix.
> x <- paste(readLines(file.path(R.home(), "COPYING")), ...