Shrink numeric matrix by groups of rows
Arguments
- x
numeric matrix
- groupBy
vector of group labels, whose length equals
nrow(x). These values will become rownames in the output data.- shrinkFunc
function that takes vector input and returns vector output. The vector class can be checked, in order to call a function on numeric or character data separately, as needed.
- returnClass
character string indicating the return data type,
"data.frame"returns adata.framewhose first column contains entries fromgroups;"matrix"returns a numeric matrix whose rownames are entries fromgroups.- verbose
logical indicating whether to print verbose output.
Details
This function is mainly a wrapper around the very efficient
functions in the data.table package, with the ability to
provide a custom function to shrink row values.
See also
Other Internal utility functions:
combineGRcoverage(),
compressPolygonM(),
df2colorSub(),
dfWide2segments(),
escapeWhitespaceRegexp(),
factor2label(),
geomean(),
intercalate(),
internal_junc_score(),
jamGeomean(),
list2im(),
simplifyXY(),
stackJunctions(),
strsplitOrdered()