text <- c("A rose is a rose is a rose.",
"A Rose is red, a violet is blue!",
"A rose by any other name would smell as sweet.")
term_matrix(text)
# select certain terms
f <- text_filter(select = c("rose", "red", "violet", "sweet"))
term_matrix(text, f)
# specify a grouping factor
term_matrix(text, f, group = c("Good", "Bad", "Good"))
# weight the texts
term_matrix(text, f, weights = c(1, 2, 10),
group = c("Good", "Bad", "Good"))
Run the code above in your browser using DataLab