View source: R/002-pk.business.rules.R
pk.business | R Documentation |
PKNCA.options("max.missing")
.Note that all missing values are removed prior to calling the function.
pk.business(FUN, zero.missing = FALSE, max.missing)
FUN |
function to run. The function is called as |
zero.missing |
Are zeros counted as missing? If |
max.missing |
The maximum fraction of the data allowed to be missing (a number between 0 and 1, inclusive). |
A version of FUN that can be called with parameters that are checked
for missingness (and zeros) with missing (and zeros) removed before the
call. If max.missing
is exceeded, then NA is returned.
my_mean <- pk.business(FUN=mean)
mean(c(1:3, NA))
# Less than half missing results in the summary statistic of the available
# values.
my_mean(c(1:3, NA))
# More than half missing results in a missing value
my_mean(c(1:3, rep(NA, 4)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.