\begin{Schunk}
\begin{Sinput}
 gsub("Texas$", "TX", cities)
\end{Sinput}
\begin{Soutput}
 [1] "Dallas TX"                        "Denver Colorado"                 
 [3] "Austin TX"                        "Salem Oregon"                    
 [5] "Salem Massachusetts"              "California Pennsylvania"         
 [7] "Long Beach California"            "San Francisco California"        
 [9] "Texas Missouri"                   "Nevada Missouri"                 
[11] "St. Louis Missouri"               "Truth or Consequences New Mexico"
[13] "Charleston South Carolina"        "Charleston North Carolina"       
\end{Soutput}
\end{Schunk}
