title: Renaming character variables in a column in data frame - R
body: <p>I have a data frame that contains a column called ProjectSubject. The data frame is approximately 1,000,000 rows long.</p>
  
  <p>Within the ProjectSubject column, I have lots of different strings. Here is an example:</p>
  
  <pre><code>&gt;unique(unlist(projectdf$ProjectSubject))
  
  [1] "Applied Learning"                           "Applied Learning, Literacy 
  &amp; Language"     
  [3] "Literacy &amp; Language"                        "Special Needs"                             
  [5] "Literacy &amp; Language, History &amp; Civics"      "Math &amp; Science"                            
  [7] "History &amp; Civics, Math &amp; Science"           "Literacy &amp; Language, 
  Special Needs"        
  [9] "Applied Learning, Special Needs"            "Health &amp; Sports, Special 
  Needs"            
  [11] "Math &amp; Science, Literacy &amp; Language"        "Literacy &amp; Language, Math 
  &amp; Science"       
  [13] "Literacy &amp; Language, Music &amp; The Arts"      "Math &amp; Science, Special 
  Needs"             
  [15] "Health &amp; Sports"                            "Music &amp; The Arts"                          
  [17] "Math &amp; Science, Applied Learning"           "Literacy &amp; Language, 
  Applied Learning"     
  [19] "Applied Learning, Music &amp; The Arts"         "History &amp; Civics, 
  Literacy &amp; Language"     
  [21] "Applied Learning, Math &amp; Science"           "Health &amp; Sports, Math &amp; 
  Science"           
  [23] "Applied Learning, Health &amp; Sports"          "History &amp; Civics"                          
  [25] "History &amp; Civics, Music &amp; The Arts"         "Math &amp; Science, History &amp; 
  Civics"          
  [27] "Math &amp; Science, Music &amp; The Arts"           "Special Needs, Music &amp; 
  The Arts"           
  [29] "History &amp; Civics, Applied Learning"         "History &amp; Civics, Special 
  Needs"           
  </code></pre>
  
  <p>I need a succinct, non-manual way to go over the entire column in the data frame and replace a bunch of these strings with a different one. For example, I would like to replace "Applied Learning, Special Needs" with "Special Needs", or similarly replace "Applied Learning, Math &amp; Science" with "Math".</p>
  
  <p>I have about 50 unique strings much like the sample code given above that I want to reduce to about 10 unique strings. Preferably there is a method where I don't have to do this without manually typing a line of code for each of the 50 strings.</p>