title: R - convert factor() column into a Binary Matrix Value
body: <p>I am quite new to R, and I need R to recognize some of data as binary. So I made a survey and <strong>I'd like R to analyze the Gender, Like, and Share columns as binary</strong> - so I can ggplot them properly.</p>
  
  <pre><code>head(d)
    Gender Age Like Share
  1   Male  26   No     2
  2   Male  23  Yes     0
  3 Female  21   No     4
  4   Male  19   No     0
  5 Female  20  Yes     0
  6   Male  23   No     4
  </code></pre>
  
  <p>The thing is that I would like to evaluate if there's a corrolation between certain factors - and to do so, I want to do a regression line that would look like this. But the problem is that <strong>I always get this error message</strong></p>
  
  <pre><code>M &lt;- ggplot(data=d,aes(x=Age,colour=Share) + geom_point())
  
  Error in aes(x = Age, colour = Share) + geom_point() : 
    non-numeric argument to binary operator
  </code></pre>
  
  <p>So if you could help me out with those two problems, that'd be awesome.
  One last thing, I don't know if this could help, but in case, I'll give it to you ...</p>
  
  <pre><code> sapply(D,class)
     Gender       Age      Like     Share 
  "integer" "numeric" "integer" "integer"
  
  
  sapply(D,mode)
     Gender       Age      Like     Share 
  "numeric" "numeric" "numeric" "numeric"
  </code></pre>
  
  <p>Thanks a lot in advance !</p>