r - gsub different phrases of graphical characters -
i have dataframe containing lines of characters example:
hello name sam <u+ab93> hi love fast cars <u+e> favourite colour yellow <u+e><u+c><u+60>
how remove terms don't make sense in dataframe?
i tried apply(document, 1, function(x) gsub("<[:graph:]>", "", x))
not work.
using gsub
text = c("hello name sam <u+ab93>" , "hi love fast cars <u+e>" , "my favourite colour yellow <u+e><u+c><u+60>") df <- data.frame(doc = text) df$doc <- gsub(df$doc , pattern = "<.*>", replacement = "")
Comments
Post a Comment