Hey everyone
I am fiddling around with the stringr package and want to extract two values from a string into separate columns. My idea was first to replace the brackets by empty characters, then I have a comma-separated list that I can split. But I cannot declare the bracket as a character to be replaced.
tmp <- "[10, 20]"
str_replace_all(tmp, "[]", "")
This gives me an error that the brackets belong to the bracket expression. I tried a lot like "["[""]"]" and using \ as escape character but nothing worked.
I guess the solution is quite easy, but I cannot find it right now.
Thanks for helping!