weightSMART(m, spec = "nnn", control = list())
TermDocumentMatrixin term frequency format.
WeightingFunctionwith the additional attributes
The first letter of
spec specifies a weighting schema for term
mis assumed to be in this standard term frequency format already.
The second letter of
spec specifies a weighting schema of
document frequencies for
The third letter of
spec specifies a schema for normalization
pivotmust be set via named tags in the
The final result is defined by multiplication of the chosen term frequency component with the chosen document frequency component with the chosen normalization component.
data("crude") TermDocumentMatrix(crude, control = list(removePunctuation = TRUE, stopwords = TRUE, weighting = function(x) weightSMART(x, spec = "ntc")))