I want to change "[" too "(" in a a data.frame (class is string) but i get the following error:
Error in gsub("[", "(", df) : invalid regular expression '[', reason 'Missing ']''
Doing the revers works perfectly:
df <- gsub("]",")", df)
all "]" got replaced in the data.frame df
so in essence this is the problem
df <- gsub("[","(", df)
Error in gsub("[", "(", df) : invalid regular expression '[', reason 'Missing ']''
can anyone help to fix the code or is there an alternative function to gsub which can accomplish the same?