Learn R Programming

rgr (version 1.0.4)

inset: An EDA Graphical and Statistical Summary

Description

Plots a two panel graphical distributional summary for a data set, comprising a histogram and a cumulative normal percentage probability (CPP) plot, together with a table of selected percentiles of the data and summary statistics between them. Optionally the EDA graphics may be plotted with logarithmic scaling.

Usage

inset(xx, xlab = deparse(substitute(xx)), log = FALSE, xlim = NULL, 
	 nclass = NULL, ifnright = TRUE, ...)

Arguments

xx
name of the variable to be plotted.
xlab
a title for the x-axis. It is often desirable to replace the default x-axis title of the input variable name text string with a more informative title, e.g., xlab = "Cu (mg/kg) in <2 mm="" o-horizon="" soil"<="" code="">.
log
if it is required to display the data with logarithmic (x-axis) scaling, set log = TRUE.
xlim
default limits of the x-axis are determined in the function. However when used stand-alone the limits may be user-defined by setting xlim, see Note below.
nclass
the default procedure for preparing the histogram is to use the Scott (1979) rule. This usually provides an informative histogram, other optional rules are nclass = "sturges" or nclass = "fd"; the later standing for Freedman-Diac
ifnright
controls where the sample size is plotted in the histogram display, by default this in the upper right corner of the plot. If the data distribution is such that the upper left corner would be preferable, set ifnright = FALSE.
...
further arguments to be passed to or from methods. For example, by default individual data points in the ECDF and CPP plots are marked by a plus sign, pch = 3, if a cross or open circle is desired, then set pch = 4 or pch

Details

A histogram is displayed on the left, and a cumulative normal percentage probability plot on the right. Between the two is a table of simple summary statistics, computed in gx.stats, including minimum, maximum and percentile values, robust estimates of standard deviation, and the mean, standard deviation and coefficient of variation. The plots may be displayed with logarithmic axes, however, the summary statistics are not computed with a logarithmic transform.

References

Venables, W.N. and Ripley, B.D., 2001. Modern Applied Statistsis with S-Plus, 3rd Edition, Springer - see pp. 119 for a description of histogram bin selection computations.

See Also

gx.hist, cnpplt, gx.stats, inset.exporter, ltdl.fix.df, remove.na

Examples

Run this code
## Make test data available
data(kola.o)
attach(kola.o)

## Generates an initial display
inset(Cu)

## Provides a more appropriate display for pubication
inset(Cu, xlab = "Cu (mg/kg) in <2 mm O-horizon soil", log = TRUE)

## Detach test data
detach("kola.o")

Run the code above in your browser using DataLab