title: Remove specific last character from string
body: <p>I have following string vector: </p>
  
  <pre><code> EC02   502R   603           515    602   
   KL07   601    511R   505R   506R   503   
   508    514    501    509R   510    501R  
   512R   516    507    604    502    601R  
   SPK01  504    504R   ACK01  503R   508R  
   507R   ACK03  513    EC01   506    ECH01 
   ACK02  SPK02  509    511    512    505   
   KA01   RS01   510R   SKL01  SPK03  603R  
   602R   604R   513R   AECH01 ER03   AECH02
   RS02   514R   ER01   RH01   AR05   RH02  
   515R   ER02   M01 
  </code></pre>
  
  <p>I want to replace <code>502R to 502, 501R to 501, 503R to 503</code> and so on...</p>
  
  <p>Only character <code>R</code> has to be replaced which is occurring at the end of the string. </p>
  
  <p>How can I do it with <code>gsub</code>?</p>