freqMean | R Documentation |
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.
freqMean(values, counts)
values |
the values for which there are counts |
counts |
the counts for each of the values empty cells can be either 0 or NA |
a vector containing the mean and st.dev.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.