Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

moments

moments


Description

Calculate statistical moments of a distribution

Usage

moments(x, plot = FALSE)

Arguments

x

numeric vector

plot

plot of distribution (TRUE/FALSE)

Value

A vector with the following values:

  • min Minimum

  • 25th 25th percentile

  • mean Arithmetic mean

  • gmean Geometric mean

  • hmean Harmonic mean

  • median 50th percentile

  • 7th5 75th percentile

  • max Maximum

  • stdv Standard deviation

  • var Variance

  • cv Coefficient of variation (percent)

  • mad Median absolute deviation

  • skew Skewness

  • kurt Kurtosis

  • nmodes Number of modes

  • mode Mode (dominate)

Author(s)

Jeffrey S. Evans jeffrey_evans@tnc.org

Examples

x <- runif(1000,0,100)
    ( d <- moments(x, plot=TRUE) )
    ( mode.x <- moments(x, plot=FALSE)[16] )

spatialEco

Spatial Analysis and Modelling Utilities

v1.3-6
GPL-3
Authors
Jeffrey S. Evans [aut, cre], Melanie A. Murphy [ctb], Karthik Ram [ctb]
Initial release
2021-03-24

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.