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

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -