fork download
  1. VariableA <- c("TRS34", "MMH22", "GFSR104", "GS23", "RRTM55", "P3", "S4")
  2. gsub('(S)([0-9])','\\1-\\2',VariableA)
  3. # => [1] "TRS-34" "MMH22" "GFSR104" "GS-23" "RRTM55" "P3" "S-4"
  4.  
Success #stdin #stdout 0.27s 39064KB
stdin
Standard input is empty
stdout
[1] "TRS-34"  "MMH22"   "GFSR104" "GS-23"   "RRTM55"  "P3"      "S-4"