I want to remove second and subsequent occurrences of decimal point in string. My attempt is below:
library(stringr)
str_remove(string = "3.99-0.13", pattern = "\\.")
[1] "399-0.13"
sub("\\.", "", "3.99-0.13")
[1] "399-0.13"
However, I want the output like 3.99-013
. Any hint, please.