I would like to replace k in a string with 000. For instance, I want to make \"£50000\" from \"£50k\". Note that the function can be applied to cases like \"£50k king\", which s
How about
data = gsub("([0-9]+)k", "\\1000", data)