title: How do I append an extra column to my dataset, and give them string values, in R?
body: <p>Dataset can be found here: <a href="https://www.dropbox.com/s/l7pc11hhiwr8zzn/data.csv?dl=0" rel="nofollow">https://www.dropbox.com/s/l7pc11hhiwr8zzn/data.csv?dl=0</a> or as "nlschools" in the MASS library.</p>
  
  <p>In this dataset, I'd like to add an extra column called <code>SEScat</code>, which indexes the values in the SES column as either low (&lt;=30), med (30 &lt; SES &lt;=40), or high (>40). In my imagination, the command could look someting like this:
  <code>&gt; nlschools$SEScat &lt;- (pseudo: low if SES &lt;=30, med if 30 &lt; SES &lt;=40, high if SES &gt; 40)</code>, but I have not been able to find the fitting syntax and the documentation seems to rely on much more background knowledge than I have.</p>
  
  <p>Before this will work however, I have to make an extra column. Using <code>names(nlschools) &lt;- c("lang","IQ","class","GS","SES","COMB","SEScat")</code> does not work, because the name attribute does not have sufficient length. I'm not sure how to increase this.</p>
  
  <p>This question has came up from a previous question I asked, but I thought it might be handy for other users to have it as a separate question. I hope that is okay.</p>