| meanMedian {NCStats} | R Documentation |
This function visually illustrates how the mean “balances” distances and the median “balances” individuals in a random sample from a known population. The user can manipulate the number of individuals in the sample and the shape of the population to determine how these attributes affect the calculation of the mean and median.
meanMedian(x = NULL, outlier = c("none", "max", "min"))
x |
An optional numeric vector (of actual data) to be used in the visual. |
outlier |
A string indicating whether the outlier
should be modeled at the maximum ( |
None, but a graphic (if x is not null) or a
dynamic graphic with slider bars (if x is
null) is produced.
if (interactive()) {
## Examples with simulated data
## no outlier
meanMedian()
## outlier at minimum
meanMedian(outlier="min")
## no outlier
meanMedian(outlier="max")
}
## Example with user-derived data
meanMedian(c(1:7,25))