gm_mean: gm_means

View source: R/MODULE_2_PREP.R

gm_meanR Documentation

gm_means

Description

Function to calculate geometric mean of positive numbers in a vector

Usage

gm_mean(x, na.rm = TRUE)

Arguments

x

A vector of numbers (may include zero or negative numbers)

Details

Zeros and negative numbers will be effectively treated as 1: They will not contribute to the product of numbers but will be included in calculation of vector length. Compare with gm_mean_z.

Value

Geometric mean of the vector with the zeros and negative numbers replaced by 1


goodarzilab/Ribolog documentation built on Oct. 7, 2022, 10:14 p.m.