Eddie Eddie - 1 year ago 121
R Question

Library (stringr) doesn't work for "|"

I use stringer package to replace some of the characters. It is perfectly fine for all the characters but surprisingly doesn't work for |. I wish to remove |. But it doesn't work.


dts$new <- str_replace_all(dts$Campaign, "|", "")

my data set is

id Campaign
1 C|D|E

and I wish the following output:

id Campaign

Answer Source
 str_replace_all(dts$Campaign, "[|]", "")
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download