Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

WeightFunction

Weighting Function


Description

Construct a weighting function for term-document matrices.

Usage

WeightFunction(x, name, acronym)

Arguments

x

A function which takes a TermDocumentMatrix with term frequencies as input, weights the elements, and returns the weighted matrix.

name

A character naming the weighting function.

acronym

A character giving an acronym for the name of the weighting function.

Value

An object of class WeightFunction which extends the class function representing a weighting function.

Examples

weightCutBin <- WeightFunction(function(m, cutoff) m > cutoff,
                               "binary with cutoff", "bincut")

tm

Text Mining Package

v0.7-8
GPL-3
Authors
Ingo Feinerer [aut, cre] (<https://orcid.org/0000-0001-7656-8338>), Kurt Hornik [aut] (<https://orcid.org/0000-0003-4198-9911>), Artifex Software, Inc. [ctb, cph] (pdf_info.ps taken from GPL Ghostscript)
Initial release
2020-11-17

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.