title: How to substitute multiple alphanumeric characters in R?
body: <p>In a dataframe <code>DF</code> which is as follows:</p>
  
  <pre><code>DF$Values
  
  Values
  B1
  A
  A2
  B
  B2
  A1
  C2
  C1
  C
  </code></pre>
  
  <p>I want to substitute <code>A2,B,B2</code> as <code>Group1</code>, <code>B1,C2,C1,C</code> as <code>Group2</code>, and <code>A1, A</code> as <code>Group3</code> and so on. Such that the output data looks like this</p>
  
  <pre><code>Values
  Group2
  Group3
  Group1
  Group1
  Group1
  Group3
  Group2
  Group2
  Group2
  </code></pre>
  
  <p>I tried using <code>gsub()</code> but it is not working properly for me, as the code 
  <code>gsub("A1|A", "Group3" ,DF)</code> replaces <code>A2</code> with <code>Group32</code></p>
  
  <p>Please help!</p>