title: creating new variable by squaring the difference of two columns in dataframe
body: <p>i want to substract and square the difference of two columns in dataframe by creating a new variable.</p>
  
  <blockquote>
    <p>IMDB1
        imdbVotes   imdbRating
        45          2700
        56          750
        N/A         800
        67          1400
        N/A         850</p>
  </blockquote>
  
  <p>when i use this code</p>
  
  <pre><code>sub=IMDB$IMDBvote-IMDB$IMDBrating
  </code></pre>
  
  <p>i get </p>
  
  <blockquote>
    <p>In Ops.factor(IMDB1$imdbRating, IMDB1$imdbVotes) :
      ‘-’ not meaningful for factors</p>
  </blockquote>
  
  <p>.then later i used </p>
  
  <pre><code>votes=as.numeric(IMDB1$imdbVotes)
  rating=as.numeric(IMDB1$imdbRating)
  </code></pre>
  
  <p>and checked still im getting</p>
  
  <blockquote>
    <p>‘-’ not meaningful for factors.</p>
  </blockquote>
  
  <p>please help me to get the square of difference of <code>imdbrating</code> and <code>imdbvoting</code> by creating new varibale</p>