txt <- "\"It's almost noon,\" it@dot.net said."
## split
x <- tokenize(txt)
x
## reconstruct
t <- paste(x, collapse = "")
t
if (require("tm", quietly = TRUE)) {
words <- readLines(system.file("stopwords", "english.dat",
package = "tm"))
remove_stopwords(x, words)
remove_stopwords(t, words, lines = TRUE)
} else
remove_stopwords(t, words = c("it", "it's"), lines = TRUE)
Run the code above in your browser using DataLab