freqMean: freqMean calculates the mean and stdev of count data

View source: R/rutils.R

freqMeanR Documentation

freqMean calculates the mean and stdev of count data

Description

freqMean calculates the mean and stdev of count data it requires both the values and their associated counts and return a vector of two numbers.

Usage

freqMean(values, counts)

Arguments

values

the values for which there are counts

counts

the counts for each of the values empty cells can be either 0 or NA

Value

a vector containing the mean and st.dev.

Examples

## Not run: 
vals <- c(1,2,3,4,5)    values=dat[,1];counts=dat[,2]
counts <- c(3,NA,7,4,2)
freqMean(vals,counts)  # should give 3.125 and 1.258306

## End(Not run)

haddonm/codeutils documentation built on April 15, 2024, 1:02 p.m.