I am trying to remove the brackets from a string value in this case:
(40.703707008, -73.943257966)
I can not find a message with code that works; I know this is a very simple task, but I have seen the following links, but they either kill all my punctuation or do not work. Below are the codes I tried. Appreciate the help:
remove brackets from string
Remove parentheses and text inside lines from R
x = ("(40.703707008, -73.943257966)")
gsub("\\s*\\([^\\)]+\\)","",x)
gsub("\\D", "", x)
gsub("log\\(", "", x)
source
share