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 parenthesis string

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

Popular posts from this blog

sql server - Cannot query correctly (MSSQL - PHP - JSON) -

php - trouble displaying mysqli database results in correct order -

C++ Linked List -