coeff_var: Calculate coefficient of variation

View source: R/methods.R

coeff_varR Documentation

Calculate coefficient of variation

Description

coeff_var is a S3 generic that calculates the coefficient of variation, defined as

CV(x) = \frac{sd(x)}{mean(x)}

Usage

coeff_var(x, na.rm = FALSE, ...)

## Default S3 method:
coeff_var(x, na.rm = FALSE, ...)

Arguments

x

Numeric vector, matrix, or array

na.rm

Logical indicating whether NA values should be stripped when calculating sums. Default: FALSE

...

Unused

Details

If x is a matrix, it will calculate the CV for each column. If x is a 3D array, it will calculate the coefficient of variation for each row-column combination. If the input dimensions are n \times n \times r, a matrix with size n \times n will be returned.

Value

A numeric vector or matrix


cwatson/brainGraph documentation built on Feb. 21, 2024, 6:33 p.m.