tfidf4dtm: Tf-IDf for DTM

View source: R/tfidf4stm.R

tfidf4dtmR Documentation

Tf-IDf for DTM

Description

Tf-IDf for DTM

Usage

tfidf4dtm(dtm, normalize = TRUE, fun = log2, adjust = TRUE,
  force = FALSE)

Arguments

dtm

an object of class DocumentTermMatrix rappresenting a DTM, in particular, with documents as row.

normalize

(lgl) if TRUE (default) the weights are normalized wrt documents, i.e. row_sum equals 1 for every row.

fun

The weighting function for the ratio of document-frequencies.

adjust

If TRUE (default) adds 1 to the denominator (i.e., the sum of the frequencies of a term into the corpora) to avoid the risk it happen to be zero.

force

(lgl) if TRUE (default is FALSE) the function works also for simple_triplet_matrix which are not DocumentTermMatrix

Value

an object of class DocumentTermMatrix and simple_triplet_matrix (in the order).


UBESP-DCTV/costumer documentation built on Feb. 1, 2023, 4:52 a.m.