med: Function to calculate median of vector excluding 0s and...

Description Usage Arguments Value Examples

View source: R/generalFunctions.R

Description

Function to calculate median of vector excluding 0s and return NA if more 0s than given threshold

Usage

1
med(x, maxNAs = 1)

Arguments

x

vector to calculate median of

maxNAs

Fraction of missing values allowed in vector, if > 0s than maxNAs an NA is returned

Value

Median value

Examples

1
2
vec <- c(0,1,0,2,5, 0, 0)
med(vec)

MJS-708/MSIprocessing documentation built on Dec. 17, 2021, 2:11 a.m.