-1

There is an example data.

|type | |1,2()| |1,3()| |1 |

I would like to remove "()" in the data.

|type | |1,2 | |1,3 | |1 |

So, I tried the "str_replace" in dplyr package.

mutate(type = str_replace(type, pattern="()", replacement =""))

But it didn't work, and there is still "()" in the data. How does it work?

marie
  • 315
  • 1
  • 9

1 Answers1

0
mutate(type = str_replace_all(type, pattern="[()]", replacement =""))
k3b
  • 344
  • 3
  • 15