powered by
Construct a weighting function for term-document matrices.
WeightFunction(x, name, acronym)
An object of class WeightFunction which extends the class
WeightFunction
function representing a weighting function.
function
A function which takes a TermDocumentMatrix with term frequencies as input, weights the elements, and returns the weighted matrix.
TermDocumentMatrix
A character naming the weighting function.
A character giving an acronym for the name of the weighting function.
weightCutBin <- WeightFunction(function(m, cutoff) m > cutoff, "binary with cutoff", "bincut")
Run the code above in your browser using DataLab