title: How does the `prop.table()` function work in r?
body: <p>I've just started learning r and have had trouble finding an (understandable) explanation of what the <code>prop.table()</code> function does. I found the following <a href="https://www.rdocumentation.org/packages/base/versions/3.4.1/topics/prop.table" rel="nofollow noreferrer">explanation</a> and example:</p>
  <blockquote>
  <p><strong>prop.table: Express Table Entries as Fraction of Marginal Table</strong></p>
  <p><strong>Examples</strong></p>
  <pre><code>m &lt;- matrix(1:4, 2)
  m
  prop.table(m, 1)
  </code></pre>
  </blockquote>
  <p>But, as a beginner, I do not understand what this explanation means. I've also attempted to discern its functionality from the result of the above example, but I haven't been able to make sense of it.</p>
  <p>With reference to the example above, what does the <code>prop.table()</code> function do? Furthermore, what is a &quot;marginal table&quot;?</p>