dtm_tfidf | R Documentation |
Term Frequency - Inverse Document Frequency calculation. Averaged by each term.
dtm_tfidf(dtm)
dtm |
an object returned by |
a vector with tfidf values, one for each term in the dtm
matrix
data(brussels_reviews_anno) x <- subset(brussels_reviews_anno, xpos == "NN") x <- x[, c("doc_id", "lemma")] x <- document_term_frequencies(x) dtm <- document_term_matrix(x) ## Calculate tfidf tfidf <- dtm_tfidf(dtm) hist(tfidf, breaks = "scott") head(sort(tfidf, decreasing = TRUE)) head(sort(tfidf, decreasing = FALSE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.