title: Converting factors to numeric values in R
body: <p>I have factors in R that are salary ranges of the form <code>$100,001 - $150,000</code>, <code>over $150,000</code>, <code>$25,000</code>, etc. and would like to convert these to numeric values (e.g. converting the factor <code>$100,001 - $150,000</code> to the integer 125000). </p>
  
  <p>Similarly I have educational categories such as <code>High School Diploma</code>, <code>Current Undergraduate</code>, <code>PhD</code>, etc. that I would like to assign numbers to (e.g., giving <code>PhD</code> a higher value than <code>High School Diploma</code>).</p>
  
  <p>How do I do this, given the dataframe containing these values?</p>