Description Usage Arguments Details Value Examples
View source: R/sims-teaching.R
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.
1 | 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.
None, but a graphic (if x
is not null
) or a dynamic graphic with sliders (if x
is null
) is produced (if using RStudio).
1 2 3 4 5 6 7 8 9 10 | ## 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.