EVOLUTION-MANAGER
Edit File: str_wrap.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Wrap strings into nicely formatted paragraphs.</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for str_wrap {stringr}"><tr><td>str_wrap {stringr}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Wrap strings into nicely formatted paragraphs.</h2> <h3>Description</h3> <p>This is a wrapper around <code><a href="../../stringi/html/stri_wrap.html">stringi::stri_wrap()</a></code> which implements the Knuth-Plass paragraph wrapping algorithm. </p> <h3>Usage</h3> <pre> str_wrap(string, width = 80, indent = 0, exdent = 0) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>string</code></td> <td> <p>character vector of strings to reformat.</p> </td></tr> <tr valign="top"><td><code>width</code></td> <td> <p>positive integer giving target line width in characters. A width less than or equal to 1 will put each word on its own line.</p> </td></tr> <tr valign="top"><td><code>indent</code></td> <td> <p>non-negative integer giving indentation of first line in each paragraph</p> </td></tr> <tr valign="top"><td><code>exdent</code></td> <td> <p>non-negative integer giving indentation of following lines in each paragraph</p> </td></tr> </table> <h3>Value</h3> <p>A character vector of re-wrapped strings. </p> <h3>Examples</h3> <pre> thanks_path <- file.path(R.home("doc"), "THANKS") thanks <- str_c(readLines(thanks_path), collapse = "\n") thanks <- word(thanks, 1, 3, fixed("\n\n")) cat(str_wrap(thanks), "\n") cat(str_wrap(thanks, width = 40), "\n") cat(str_wrap(thanks, width = 60, indent = 2), "\n") cat(str_wrap(thanks, width = 60, exdent = 2), "\n") cat(str_wrap(thanks, width = 0, exdent = 2), "\n") </pre> <hr /><div style="text-align: center;">[Package <em>stringr</em> version 1.4.0 <a href="00Index.html">Index</a>]</div> </body></html>