Learn R Programming

rgr (version 1.1.0)

gx.cnpplts: Multiple (max 9) Cumulative Normal Probability (CPP) plots

Description

Displays cumulative normal probability (CPP) plots for up to nine data subsets, using combinations of symbols and colours to identify each subset. Note CPP plots are equivalent to Q-Q plots and are more frequently used by physical scientists and engineers.

Usage

gx.cnpplts(xlab = " ", log = FALSE, xlim = NULL, main = "",
	iflgnd = FALSE, ...)

Arguments

xlab
a title for the x-axis must be provided, even if it is no title, i.e. xlab = "". It is often desirable to use an informative title, e.g., xlab = "Cu (mg/kg) in <2 mm="" c-horizon="" soil"<="" code="">.
log
log must be specified, TRUE or FALSE. If it is required to display the data with logarithmic (x-axis) scaling, set log = TRUE. If log scaling is not required, set log = FALSE.
xlim
if the internally generated values for xlim are to be replaced see the Note below. If the internally generated x-axis limits are satisfactory omit any reference to xlim in the call to the function.
main
a title must be provided, even if it is no title, i.e. main = "". If main is specified a tile will be added above the plot, e.g., main = "Kola Project, 1995".
iflgnd
iflgnd must be specified, TRUE or FALSE. If a R generated legend is to be be placed on the plot, set iflgnd = TRUE. On completion of CPP plotting the cursor is activated, locate it at the top left of t
...
the names of the data subsets (objects), separated by commas, to be plotted, up to a maximum of nine. See the example below for subset pre-processing steps that lead to a more presentable legend.

See Also

gx.cnpplts.setup, display.marks, display.lty, ltdl.fix.df, text

Examples

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

## An example
gx.cnpplts(xlab = "Cu (mg/kg) in <2 mm Kola C-horizon soil", log = TRUE, 
	xlim = NULL, main = "", iflgnd = FALSE, Cu[COUNTRY == "RUS"], 
	Cu[COUNTRY == "FIN"], Cu[COUNTRY == "NOR"])

## An example that leads to a cleaner legend
## First select data for the variable to be plotted for the subsets, from
## dimnames(kola.c) we know that Be is the 19th column in the dataframe
Norway <- gx.subset(kola.c,COUNTRY=="NOR")[,19]
Russia <- gx.subset(kola.c,COUNTRY=="RUS")[,19]
Finland <- gx.subset(kola.c,COUNTRY=="FIN")[,19]
gx.cnpplts(xlab = "Be (mg/kg) in <2 mm Kola C-horizon soils", log = TRUE,
	xlim = NULL, main  ="", iflgnd = FALSE, Finland, Russia, Norway)

## An example where the limts of the x-axis are provided
gx.cnpplts(xlab = "Be (mg/kg) in <2 mm Kola C-horizon soils", log = TRUE,
	xlim = c(0.02, 20), main  ="", iflgnd = FALSE, Finland, Russia, Norway)

## An example of a multi-element display
gx.cnpplts(xlab = "Concentrations (mg/kg) in <2 mm Kola C-horizon soils",
	log = TRUE, xlim = NULL, main = "Kola Project, 1995", 
	iflgnd = FALSE ,Cu, Ni, Co)

## Clean-up and detach test data
rm(Norway)
rm(Russia)
rm(Finland)
detach(kola.c)

Run the code above in your browser using DataLab