rp.normal: Interactive fitting of a normal distribution

View source: R/rp-normal.r

rp.normalR Documentation

Interactive fitting of a normal distribution

Description

This function plots a histogram of a sample of data and creates a panel which controls the mean and standard deviation of the normal distribution which is fitted to the data and displayed on the plot.

Usage

  rp.normal(y, ylab = deparse(substitute(y)),
            panel.plot = TRUE, hscale = NA, vscale = hscale)
  

Arguments

y

a vector of data.

ylab

a character variable used for the histogram axis label.

panel.plot

a logical parameter which determines whether the plot is placed inside the panel (TRUE) or the standard graphics window (FALSE). If the plot is to be placed inside the panel then the tkrplot library is required.

hscale, vscale

scaling parameters for the size of the plot when panel.plot is set to TRUE. The default values are 1 on Unix platforms and 1.4 on Windows platforms.

Details

The interactive controls allow a normal density curve to be added to the histogram, with doublebuttons used to control the values of the normal mean and standard deviation. The fitted normal density based on the sample mean and standard deviation can also be displayed.

Value

Nothing is returned.

References

rpanel: Simple interactive controls for R functions using the tcltk package. Journal of Statistical Software, 17, issue 9.

Examples

## Not run: 
  y <- rnorm(50, mean = 10, sd = 0.5)
  rp.normal(y)
  
## End(Not run)

rpanel documentation built on Feb. 16, 2023, 10:37 p.m.

Related to rp.normal in rpanel...