I need help in removing text using R.
Below is the file that I have:
Name Content
Re: fff . Re: fff . I am a boy. She is girl...
GGOO Laagg. jaja.
Re: QWE . Re: QWE . I am pretty.
I would like to convert the file into the output below:
Name Content
Re: fff I am a boy. She is girl...
GGOO Laagg. jaja.
Re: QWE I am pretty.
Basically is to remove the text from the Content column if it matches with the text in the Name column using R.
I tried using gsub but it doesn't work. Below is the code I tried:
r <- gsub (df$Name, "", df$Content)
Thank you in advance.