EVOLUTION-MANAGER
Edit File: sequence.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: Create A Vector of Sequences</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 sequence {base}"><tr><td>sequence {base}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Create A Vector of Sequences</h2> <h3>Description</h3> <p>For each element of <code>nvec</code> the sequence <code><a href="seq.html">seq_len</a>(nvec[i])</code> is created. These are concatenated and the result returned. </p> <h3>Usage</h3> <pre> sequence(nvec) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>nvec</code></td> <td> <p>a non-negative integer vector each element of which specifies the end point of a sequence.</p> </td></tr> </table> <h3>Details</h3> <p>Earlier versions of <code>sequence</code> used to work for 0 or negative inputs as <code>seq(x) == 1:x</code>. </p> <p>Note that <code>sequence <- function(nvec) unlist(lapply(nvec, seq_len))</code> and it mainly exists in reverence to the very early history of <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span>. </p> <h3>See Also</h3> <p><code><a href="gl.html">gl</a></code>, <code><a href="seq.html">seq</a></code>, <code><a href="rep.html">rep</a></code>. </p> <h3>Examples</h3> <pre> sequence(c(3, 2)) # the concatenated sequences 1:3 and 1:2. #> [1] 1 2 3 1 2 </pre> <hr /><div style="text-align: center;">[Package <em>base</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>