So I have a text column in data frame:
stocksavailable
140,13-,3-,40-,2-
The numbers 13-, 2- and 3- are incorrect while extracting, can we get something like this using R code?
stocksavailable
140,-13,-3,-40,-2
So I have a text column in data frame:
stocksavailable
140,13-,3-,40-,2-
The numbers 13-, 2- and 3- are incorrect while extracting, can we get something like this using R code?
stocksavailable
140,-13,-3,-40,-2
Assuming the numbers are integers, try: (\d+)(\-)?
You should be able to use the gsub method like this