title: create a column in r based on a condition involving another column
body: <p>I want to create a new column in my data set containing the proficiency level of students based on their grade in a test. So, if students grade was between 0 and 10, then the level assigned to them should be A1, if the grade is between 11 and 16, the level assigned should be A2 and so on. How to code this in R? I've tried the code below. The new column was created, but containing only the level A1. So, the condition did not work. Can anyone help me with that?</p>
  <pre><code>    data$CatEnglishTest=as.factor(ifelse(data$EnglishTestGrade %in% 
  data$EnglishTestGrade&lt;=10,'A1',
                                 ifelse(data$EnglishTestGrade %in% data$EnglishTestGrade &gt; 10 
  &amp;&amp; data$EnglishTestGrade &lt; 15,'A2',
                                        as.character(data$EnglishTestGrade))))
  </code></pre>