Removing parenthesis in R

前端 未结 1 1642
抹茶落季
抹茶落季 2021-01-02 22:17

I am trying to remove parentheses from a string value in this case this one:

(40.703707008, -73.943257966)

I can\'t seem to find a post with code that works;

相关标签:
1条回答
  • 2021-01-02 22:54

    These are metacharacters that either needs to be escaped (with \\) or we can place it in a square bracket to read it as character.

    gsub("[()]", "", x)
    #[1] "40.703707008, -73.943257966"
    
    0 讨论(0)
提交回复
热议问题