getKminmax | R Documentation |
Extract the k largest or smallest values and their indices for each column of a matrix.
getKminmax(x, k, flag = "max")
x |
a data matrix or data frame. |
k |
an integer specifying the number of extreme values. Must be
|
flag |
use "min" or "max" (default) to select smallest or largest elements. |
Order the values of each column of x
and determine the
k smallest (flag = "min"
) or largest (flag = "max"
) values and
their indices. NA's in the data are ignored.
List with elements:
|
indices of ordered extreme values |
|
ordered extreme values. |
Ariane Schad
Brombacher, E., Schad, A., Kreutz, C. (2020). Tail-Robust Quantile Normalization. BioRxiv.
# Create a data matrix x <- matrix(c(5,2,3,NA,4,1,4,2,3,4,6,NA,1,3,1),ncol=3) # Get indices of the 5 largest values in each column getKminmax(x, k = 5, "max")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.