WeightFunction {tm} | R Documentation |
Constructs a weighting function for term-document matrices.
WeightFunction(object, name)
object |
a function which takes a dgCMatrix term-document
matrix with term frequencies as input, weights the elements, and
returns the weighted matrix. |
name |
a character naming the weighting function |
An S4 object of class WeightFunction
which extends the class
function
representing a weighting function.
Ingo Feinerer
weightCutBin <- WeightFunction(function(m, cutoff) as(m > cutoff, "dgCMatrix"), "binary with cutoff")