title: Convert part of string to upper (or lower) case
body: <p>I have a vector with sample locations, here's a sample:</p>
  
  <pre><code>test &lt;- c("Aa, Heeswijk T1", "Aa, Heeswijk t1", 
            "Aa, Middelrode t2", "Aa, Middelrode p1",
            "Aa, Heeswijk t1a", "Aa, Heeswijk t3b",
            "Aa, test1 T1", "Aa, test2 t1")
  </code></pre>
  
  <p>These strings are made out of a location name ("Aa, Heeswijk"), a route code ("T1", "p2", "t3") and sometimes a subroute ("a" or "b"). Unfortunately the route codes (t1, t2, p1, t1a) are sometimes in upper and sometimes in lower case. <strong>I want to have all the route codes in UPPER case, leaving the name and subroute unchanged</strong>. My expected outcome is:</p>
  
  <pre><code>"Aa, Heeswijk T1", "Aa, Heeswijk T1", 
  "Aa, Middelrode T2", "Meander Assendelft P1",
  "Aa, Heeswijk T1a", "Aa, Heeswijk T3b"
  "Aa, test1 T1", "Aa, test2 T1"
  </code></pre>
  
  <p>I have looked at <code>toupper()</code> but that changes to whole string. I could also use gsub:</p>
  
  <pre><code>gsub("t1","T1", test)
  gsub("t2","T2", test)
  #etc.
  </code></pre>
  
  <p>But there must be a better R-ish way?!<br>
  Note: Route codes are always 2 chars long, have a char and an integer and are preceded by a space. So the char to change to upper is always located at the second or third from last.</p>