EVOLUTION-MANAGER
Edit File: margin.table.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: Compute table margin</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 margin.table {base}"><tr><td>margin.table {base}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Compute table margin</h2> <h3>Description</h3> <p>For a contingency table in array form, compute the sum of table entries for a given index. </p> <h3>Usage</h3> <pre> margin.table(x, margin = NULL) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>an array</p> </td></tr> <tr valign="top"><td><code>margin</code></td> <td> <p>index number (1 for rows, etc.) </p> </td></tr> </table> <h3>Details</h3> <p>This is really just <code>apply(x, margin, sum)</code> packaged up for newbies, except that if <code>margin</code> has length zero you get <code>sum(x)</code>. </p> <h3>Value</h3> <p>The relevant marginal table. The class of <code>x</code> is copied to the output table, except in the summation case. </p> <h3>Author(s)</h3> <p>Peter Dalgaard</p> <h3>See Also</h3> <p><code><a href="prop.table.html">prop.table</a></code> and <code><a href="../../stats/html/addmargins.html">addmargins</a></code>. </p> <h3>Examples</h3> <pre> m <- matrix(1:4, 2) margin.table(m, 1) margin.table(m, 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>