So I have a dfm_tfidf and I want filter out values that are below a certain threshold.
Code:
dfmat2 <-
matrix(c(1,1,2,1,0,0, 1,1,0,0,2,3),
byrow = TRUE, nrow = 2,
dimnames = list(docs = c("document1", "document2"),
features = c("this", "is", "a", "sample",
"another", "example"))) %>%
as.dfm()
#it works
dfmat2 %>% dfm_trim(min_termfreq = 3)
#it does not work
dfm_tfidf(dfmat2) %>% dfm_trim( min_termfreq = 1)
# "Warning message: In dfm_trim.dfm(., min_termfreq = 1) : dfm has been previously weighted"
Question: How can I filter out the values present in the dfm_tfidf?
Thank you