filter_matrix_by_rank: Filter a matrix based on the rank of the values in each row

Description Usage Arguments Value

View source: R/RcppExports.R

Description

This function filters an input matrix, by ranking the data in each row from largest to smallest, and setting any element whose rank is greater than the input threshold to 0. In other words, if the treshold is X, only the X greatest values in each row will be kept, and the rest will be set to 0. WARNING: the input matrix is modified in-place.

Usage

1
filter_matrix_by_rank(m, threshold)

Arguments

m

The input matrix

threshold

The threshold rank. Values with rank greater than the threhsold will be set to 0. Note that the rank is 1-based (i.e. the largest observation has rank 1)

Value

This function does not return any value. The input matrix is modified in-place.


ParkerICI/scgraphs documentation built on April 30, 2021, 1:10 p.m.