title: Probability in R data frames
body: <p>I am working on bigger probability problem using naive bayes, but for right now I am stuck on how to get a smaller part of the problem. Here is an example of the df I am working on. </p>
  
  <pre><code>d = data.frame(work=c("unemployed","govt worker", "teacher", "unemployed"),
                 race=c("white","black", "white", "white"),
                 sex=c("male","female", "female", "male"))
  &gt; d
           work  race    sex
  1  unemployed white   male
  2 govt worker black female
  3     teacher white female
  4  unemployed white   male
  </code></pre>
  
  <p>The question Im trying to answer is:
  What is the probability a white male is unemployed? </p>
  
  <p>I think the first step is building a likelihood table but I don't know how to go about creating one. </p>
  
  <p>Any idea on how to go about this?
  Thank you.</p>