Learn R Programming

rgr (version 1.1.15)

gx.ecdf: Emprical Cumulative Distribution Function (ECDF)

Description

Displays an empirical cumulative distribution function (ECDF) plot with a zero-to-one linear y-scale as part of the multi-panel display provided by shape. The function may also be used stand-alone.

Usage

gx.ecdf(xx, xlab = deparse(substitute(xx)), 
	ylab = "Empirical Cumulative Distribution Function", log = FALSE,
	xlim = NULL, main = "", pch = 3, ifqs = FALSE, cex = 0.8, ...)

Arguments

xx

name of the variable to be plotted.

xlab

by default the character string for xx is used for the x-axis title. An alternate title can be displayed with xlab = "text string", see Examples.

ylab

a title for the y-axis, defaults to "Emprical Cumulative Distribution Function".

log

to display the data with logarithmic (x-axis) scaling, set log = TRUE.

xlim

when used in the shape function, xlim is determined by gx.hist and used to ensure all four panels in shape have the same x-axis scaling. However, when used stand-alone the limits may be user-defined by setting xlim, see Note below.

main

when used stand-alone a title may be added optionally above the plot by setting main, e.g., main = "Kola Project, 1995".

pch

by default the plotting symbol is set to a plus, pch = 3, alternate plotting symbols may be chosen from those displayed by display.marks, see also Notes below.

ifqs

setting ifqs = TRUE results in horizontal and vertical dotted lines being plotted at the three central quartiles and their values, respectively.

cex

by default the size of the text for data set size, N, is set to 80%, i.e. cex = 0.8, and may be changed if required.

further arguments to be passed to methods. The colour of the plotting symbols may be changed from default blach, e.g., col = 2 for red. The size of the axis scale annotation can be change by setting cex.axis, the size of the axis titles by setting cex.lab, and the size of the plot title by setting cex.main. For example, if it is required to make the plot title smaller, add cex.main = 0.9 to reduce the font size by 10%.

See Also

display.marks, ltdl.fix.df, remove.na

Examples

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

## Plot a simple ECDF
gx.ecdf(Cu)

## Plot an ECDF with more appropriate labelling and with the quartiles
## indicated
gx.ecdf(Cu , xlab = "Cu (mg/kg) in <2 mm Kola O-horizon soil", log = TRUE, 
ifqs = TRUE)   

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

Run the code above in your browser using DataLab