EVOLUTION-MANAGER
Edit File: row.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: Row Indexes</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 row {base}"><tr><td>row {base}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Row Indexes</h2> <h3>Description</h3> <p>Returns a matrix of integers indicating their row number in a matrix-like object, or a factor indicating the row labels. </p> <h3>Usage</h3> <pre> row(x, as.factor = FALSE) .row(dim) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>a matrix-like object, that is one with a two-dimensional <code>dim</code>.</p> </td></tr> <tr valign="top"><td><code>dim</code></td> <td> <p>a matrix dimension, i.e., an integer valued numeric vector of length two (with non-negative entries).</p> </td></tr> <tr valign="top"><td><code>as.factor</code></td> <td> <p>a logical value indicating whether the value should be returned as a factor of row labels (created if necessary) rather than as numbers.</p> </td></tr> </table> <h3>Value</h3> <p>An integer (or factor) matrix with the same dimensions as <code>x</code> and whose <code>ij</code>-th element is equal to <code>i</code> (or the <code>i</code>-th row label). </p> <h3>References</h3> <p>Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) <em>The New S Language</em>. Wadsworth & Brooks/Cole. </p> <h3>See Also</h3> <p><code><a href="col.html">col</a></code> to get columns; <code><a href="slice.index.html">slice.index</a></code> for a general way to get slice indices in an array. </p> <h3>Examples</h3> <pre> x <- matrix(1:12, 3, 4) # extract the diagonal of a matrix - more slowly than diag(x) dx <- x[row(x) == col(x)] dx # create an identity 5-by-5 matrix more slowly than diag(n = 5): x <- matrix(0, nrow = 5, ncol = 5) x[row(x) == col(x)] <- 1 x (i34 <- .row(3:4)) stopifnot(identical(i34, .row(c(3,4)))) # 'dim' maybe "double" </pre> <hr /><div style="text-align: center;">[Package <em>base</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>