title: Find probability in R
body: <p>I have to find the probability that AFC team wins a game given that they won the game before?</p>
  <p>My data looks like:</p>
  <pre><code>df &lt;- &quot; hometeam    awayteam    result  season
      AFC      BFC          WH       S1
      DFC      AFC          WA       S2
      HFC      BFC          D       S2
      MFC      AFC          WA       S1
      BFC      AFC          L       S3
      DFC      KFC          L       S2
      AFC      DFC          WH       S3&quot;
  df &lt;- read.table(text = df, header = TRUE)
  </code></pre>
  <p>P(AFC Wins| Previous game won)?</p>
  <p>How do I find the count for WW in basic R?</p>
  <p>I want to count the instances for WH-WA &amp; WA-WH together(WH-Home Win,WA- Away Win) so here we see 2 instance (Similarly WA-WA, WH-WH).</p>
  <p>How do I find the count for each?</p>