Cumulative Geometric Mean — cgmean • TidyDensity
Description: A function to return the cumulative geometric mean of a vector.

Skip to contents

# Cumulative Geometric Mean

Source: `R/vec-cumulative-functions.R`
`cgmean.Rd`

A function to return the cumulative geometric mean of a vector.

## Usage

    cgmean(.x)

## Arguments

.x

  A numeric vector

## Value

A numeric vector

## Details

A function to return the cumulative geometric mean of a vector. `exp(cummean(log(.x)))`

## See also

Other Vector Function: `bootstrap_p_vec()`, `bootstrap_q_vec()`, `chmean()`, `ckurtosis()`, `cmean()`, `cmedian()`, `csd()`, `cskewness()`, `cvar()`, `tidy_kurtosis_vec()`, `tidy_scale_zero_one_vec()`, `tidy_skewness_vec()`

## Author

Steven P. Sanderson II, MPH

## Examples

    x <- mtcars$mpg

    cgmean(x)
    #>  [1] 21.00000 21.00000 21.58363 21.53757 20.93755 20.43547 19.41935 19.98155
    #>  [9] 20.27666 20.16633 19.93880 19.61678 19.42805 19.09044 18.33287 17.69470
    #> [17] 17.50275 18.11190 18.61236 19.17879 19.28342 19.09293 18.90457 18.62961
    #> [25] 18.65210 18.92738 19.15126 19.46993 19.33021 19.34242 19.18443 19.25006