tcount: frequency of entries, ordered by frequency

tcountR Documentation

frequency of entries, ordered by frequency

Description

frequency of entries, ordered by frequency

frequency of entries, ordered by frequency, minimum count 2

Usage

tcount(
  x,
  minCount = NULL,
  doSort = TRUE,
  maxCount = NULL,
  nameSortFunc = sort,
  ...
)

tcount2(
  x,
  minCount = 2,
  doSort = TRUE,
  maxCount = NULL,
  nameSortFunc = sort,
  ...
)

Arguments

x

character, numeric, factor vector input to use when calculating frequencies.

minCount

optional integer minimum frequency, any results with fewer counts observed will be omitted from results.

doSort

logical whether to sort results decreasing by frequency.

maxCount

optional integer maximum frequency for returned results.

nameSortFunc

function used to sort results after sorting by frequency. For example, one might use mixedSort(). If nameSortFunc=NULL then no name sort will be applied.

...

additional parameters are ignored.

Details

This function mimics output from table() with two key differences. It sorts the results by decreasing frequency, and optionally filters results for a minimum frequency. It is effective when checking for duplicate values, and ordering them by the number of occurrences.

This function is useful when working with large vectors of gene identifiers, where it is not always obvious whether genes are replicated in a particular technological assay. Transcript microarrays for example, can contain many replicated genes, but often only a handful of genes are highly replicated, while the rest are present only once or twice on the array.

This function is a simple customization of tcount() with minCount=2 so it only reports frequencies of 2 or higher.

Value

integer vector of counts, named by the unique input values in x.

integer vector of counts, named by the unique input values in x, by default limited to entries with frequency 2 or higher.

See Also

Other jam string functions: asSize(), breaksByVector(), cPasteSU(), cPasteS(), cPasteUnique(), cPasteU(), cPaste(), fillBlanks(), formatInt(), gsubOrdered(), gsubs(), makeNames(), mixedOrder(), mixedSortDF(), mixedSorts(), mixedSort(), mmixedOrder(), nameVectorN(), nameVector(), padInteger(), padString(), pasteByRowOrdered(), pasteByRow(), sizeAsNum(), ucfirst(), uniques()

Other jam string functions: asSize(), breaksByVector(), cPasteSU(), cPasteS(), cPasteUnique(), cPasteU(), cPaste(), fillBlanks(), formatInt(), gsubOrdered(), gsubs(), makeNames(), mixedOrder(), mixedSortDF(), mixedSorts(), mixedSort(), mmixedOrder(), nameVectorN(), nameVector(), padInteger(), padString(), pasteByRowOrdered(), pasteByRow(), sizeAsNum(), ucfirst(), uniques()

Examples

testVector <- rep(c("one", "two", "three", "four"), c(1:4));
tcount(testVector);
tcount(testVector, minCount=2);


jmw86069/jamba documentation built on Oct. 9, 2024, 10:52 a.m.