I am replacing one text in R using sub.
x<-"My name is ${name}"
sub("${name}","Tiger",x)
Error message:
Error in sub("${name}", "Tiger", x) :
invalid regular expression '${name}', reason 'Invalid contents of {}'
The input text has {}, how to fix this error?
source
to share