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 may plot their own data or compute a random sample from a beta distribution where the number of individuals in the sample and the shape of the population may be dynamically manipulated to determine how these attributes affect the calculation of the mean and median.
meanMedian(x = NULL, breaks = NULL, outlier = c("none", "max", "min"))
x |
An optional numeric vector (of actual data) to be used in the visual. |
breaks |
See description for |
outlier |
A string that indicates whether the outlier should be modeled at the maximum ( |
If the user is using RStudio and the manipulate package is installed then the dynamic graph is produced in the “Plots” pane of RStudio. The plot controls may be accessed through the “gear” that is in the upper-left corner of the plot. If the user is not using RStudio or the manipulate package is not installed, then an attempt is made to produce the dynamic graph with Tcl/Tk using the functions in the relax package.
None, but a graphic (if x
is not null
) or a dynamic graphic with sliders (if x
is null
) is produced.
## Not run: ## Examples with simulated data meanMedian() meanMedian(breaks=20) ## End(Not run) ## Example with user-derived data meanMedian(c(1:7,25)) meanMedian(c(1:7,25),breaks=3)