EVOLUTION-MANAGER
Edit File: lower.to.upper.tri.inds.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: Permute Indices for Triangular Matrices</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 lower.to.upper.tri.inds {cluster}"><tr><td>lower.to.upper.tri.inds {cluster}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Permute Indices for Triangular Matrices</h2> <h3>Description</h3> <p>Compute index vectors for extracting or reordering of lower or upper triangular matrices that are stored as contiguous vectors. </p> <h3>Usage</h3> <pre> lower.to.upper.tri.inds(n) upper.to.lower.tri.inds(n) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>n</code></td> <td> <p>integer larger than 1.</p> </td></tr> </table> <h3>Value</h3> <p>integer vector containing a permutation of <code>1:N</code> where <i>N = n(n-1)/2</i>. </p> <h3>See Also</h3> <p><code><a href="../../base/html/lower.tri.html">upper.tri</a></code>, <code><a href="../../base/html/lower.tri.html">lower.tri</a></code> with a related purpose.</p> <h3>Examples</h3> <pre> m5 <- matrix(NA,5,5) m <- m5; m[lower.tri(m)] <- upper.to.lower.tri.inds(5); m m <- m5; m[upper.tri(m)] <- lower.to.upper.tri.inds(5); m stopifnot(lower.to.upper.tri.inds(2) == 1, lower.to.upper.tri.inds(3) == 1:3, upper.to.lower.tri.inds(3) == 1:3, sort(upper.to.lower.tri.inds(5)) == 1:10, sort(lower.to.upper.tri.inds(6)) == 1:15) </pre> <hr /><div style="text-align: center;">[Package <em>cluster</em> version 2.0.8 <a href="00Index.html">Index</a>]</div> </body></html>