How do I delete a number (one or two digits in length) and the dot directly preceding it each time it occurs at the end of a string within a specific variable in R
R
The best way to do this is with a regular expression replacement statement. How you do this depends on the language that you are using.
Here's the regex pattern you need to identify the trailing numbers
(.\d{1,2})^
And you should simply replace the matches with ""
""