I am attempting to utilise R for some basic text analytics.
I have a column containing complex data type. I wish to maintain a separate table that I can use to remove certain phrases from the 1st data column.
I have tried gsubfn but without any success.
For example
dirtydata <- c("JOHN COURT","@PETER","BOB 22","RUPERT BODY CORPORATE")
removefields <-c("COURT","BODY CORPORATE")
Why does
x <- gsubfn(removefields,"",dirtydata)
not work?
Hoping for an output
c("JOHN ","@PETER","BOB 22","RUPERT ")