Skip to contents

Compute the mean and the standard deviation of a data set represented by the pair of the numeric vectors data and optionally its frequency vector freq.

Usage

datastats(data, freq = NULL)

Arguments

data

A numeric vector of a data set.

freq

A frequency vector corresponding to the data vector. The default value is NULL, which means all frequencies are one.

Value

The mean and the standard deviation of a data set.

See also

Examples

## Without a frequency data
datastats(mix2gauss$n200)
#> [[1]]
#> [1] 0.4503117
#> 
#> [[2]]
#> [1] 1.022398
#> 
## With a frequency data
datastats(mix2gaussHist$n200p, mix2gaussHist$n200f)
#> [[1]]
#> [1] 0.2994202
#> 
#> [[2]]
#> [1] 1.064247
#>