shrinkMatrix | R Documentation |
Shrink numeric matrix by groups of rows
shrinkMatrix(
x,
groupBy,
shrinkFunc = function(x) {
.Internal(mean(x))
},
returnClass = c("data.frame", "matrix"),
verbose = FALSE,
...
)
x |
numeric matrix |
groupBy |
vector of group labels, whose length equals |
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,
|
verbose |
logical indicating whether to print verbose output. |
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.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.