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, infreqs)
the values for which there are 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)
counts <- c(3,NA,7,4,2)
freqMean(vals,counts) # should give 3.125 and 1.258306
# }
Run the code above in your browser using DataLab