Multiple (max 9) Cumulative Normal Probability (CPP) plots
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.
a title for the x-axis must be provided, even if it is ‘no title’, i.e.
to display the data with logarithmic (x-axis) scaling, set
if the internally generated values for
a title must be provided, even if it is ‘no title’, i.e.
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.
Unlike most other functions in ‘rgr’ all the arguments must be specified explicitly, except
xlim. This is the cost of being able to append up to nine subset names in the function call. The function needs to know where subset names start in the list passed to the function.
A default allocation of symbols and colours, and the size of the legend text, is provided in
gx.cnpplts.setup. These may be edited if required, they are imported into
gx.cnpplts at function run time.
Any less than detection limit values represented by negative values, or zeros or other numeric codes representing blanks in the data, must be removed prior to executing this function, see
NAs in the data vector are removed prior to displaying the plot.
Although this function is most frequently used to compare the frequency distributions for the same element in multiple subsets of the data, it may also be used to display frequency distributions for multiple elements.
If it is required to set the x-axis limits to specific values they can be set, e.g.,
xlim = c(0, 200) or
c(2, 200), the latter being appropriate for a logarithmically scaled plot, i.e.
log = TRUE. If the defined limits lie within the observed data range a truncated plot will be displayed. Setting the limits wider than the default limits can provide additional space for annotation of the display.
iflgnd = FALSE no internally generated legend will be added. Alternately, a legend can be constructed with the
text function and placed with the
locator at execution of the
Robert G. Garrett
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
## 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 data frame 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 limits 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)