edges: Cut certain entries from a matrix.

Description Usage Arguments Value Examples

View source: R/edges.R

Description

This function returns to M. M is a matrix whose number of non-zero entries equals to edgeRank.

Usage

1
edges(M, edgeRank)

Arguments

M

M is a numerical matrix.

edgeRank

edgeRank is the number of non-zero of matrix M.

Value

M is a matrix whose number of non-zero entries equals to edgeRank.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (M, edgeRank)
{
    M[rank(abs(M)) < (nrow(M) * ncol(M) - edgeRank + 1)] <- 0
    return(M)
  }

xzheng-ac/scPADGRN documentation built on July 26, 2020, 12:41 a.m.