Construct a weighting function for term-document matrices.
WeightFunction(x, name, acronym)
- A function which takes a
TermDocumentMatrixwith term frequencies as input, weights the elements, and returns the weighted matrix.
- A character naming the weighting function.
- A character giving an acronym for the name of the weighting function.
An object of class
WeightFunctionwhich extends the class
functionrepresenting a weighting function.
weightCutBin <- WeightFunction(function(m, cutoff) m > cutoff, "binary with cutoff", "bincut")
Looks like there are no examples yet.