EVOLUTION-MANAGER
Edit File: strrep.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: Repeat the Elements of a Character Vector</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 strrep {base}"><tr><td>strrep {base}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Repeat the Elements of a Character Vector</h2> <h3>Description</h3> <p>Repeat the character strings in a character vector a given number of times (i.e., concatenate the respective numbers of copies of the strings). </p> <h3>Usage</h3> <pre> strrep(x, times) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>a character vector, or an object which can be coerced to a character vector using <code>as.character</code>.</p> </td></tr> <tr valign="top"><td><code>times</code></td> <td> <p>an integer vector giving the (non-negative) numbers of times to repeat the respective elements of <code>x</code>.</p> </td></tr> </table> <h3>Details</h3> <p>The elements of <code>x</code> and <code>times</code> will be recycled as necessary (if one has no elements, and empty character vector is returned). Missing elements in <code>x</code> or <code>times</code> result in missing elements of the return value. </p> <h3>Value</h3> <p>A character vector with the elements of the given character vector repeated the given numbers of times. </p> <h3>Examples</h3> <pre> strrep("ABC", 2) strrep(c("A", "B", "C"), 1 : 3) ## Create vectors with the given numbers of spaces: strrep(" ", 1 : 5) </pre> <hr /><div style="text-align: center;">[Package <em>base</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>