regex - Removing parenthesis in R -
i trying remove parentheses string value in case one:
(40.703707008, -73.943257966)
i can't seem find post code works; know simple task, i've seen following links either kill punctuation or don't seem work. below codes i've tried. appreciate help:
remove parentheses , text within strings in r
x = ("(40.703707008, -73.943257966)") gsub("\\s*\\([^\\)]+\\)","",x) gsub("\\d", "", x) gsub("log\\(", "", x)
these metacharacters either needs escaped (with \\) or can place in square bracket read character.
gsub("[()]", "", x) #[1] "40.703707008, -73.943257966"
Comments
Post a Comment