Learn R Programming

rgr (version 1.1.0)

xyplot.eda8: Display a Third Variable in a X-Y Plot as Percentiles

Description

Displays a third variable on a X-Y plot where the the third variable is represented by symbols indicating within which group defined by the data's 2nd, 5th, 25th, 50th, 75th, 95th and 98th percentiles plotted a data value falls. The colours of the symbols may be optionally changed.

Usage

xyplot.eda8(xx, yy, zz, sfact = 1, xlim = NULL, ylim = NULL, 
	xlab = deparse(substitute(xx)), ylab = deparse(substitute(yy)), 
	zlab = deparse(substitute(zz)), main = "", log = NULL,
	ifgrey = FALSE, symcolr = NULL, ...)

Arguments

xx
name of the x-axis variable.
yy
name of the y-axis variable.
zz
name of the third variable to be plotted.
sfact
controls the absolute size of the plotted symbols, by default sfact = 1. Increasing sfact results in larger symbols.
log
if it is required to display the data with logarithmic axis scaling, set log = "x" for a logarithmically scaled x-axis, log = "y" for a logarithmically scaled y-axis, and log = "xy" for both axes logarithmically scal
xlim
user defined limits for the x-axis, see Details below.
ylim
user defined limits for the y-axis, see Details below.
xlab
the x-axis title, by default the variable name, deparse(substitute(xx)). 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 = "Fe (mg/kg) in stream
ylab
the y-axis title, by default the variable name, deparse(substitute(yy)). It is often desirable to replace the default y-axis title of the input variable name text string with a more informative title, e.g., ylab = "Mn (mg/kg) in stream
zlab
by default, zlab = deparse(substitute(zz)), a plot title is generated by appending the input variable name text string to Proportional Symbol Plot for. Alternative titles may be generated, see Details below.
main
an alternative plot title, see Details below.
ifgrey
set ifgrey = TRUE if a grey-scale plot is required, see Details below.
symcolr
the default is a colour plot and default colours are provided, deeper blues for lower values, green for the middle 50% of the data, and oranges and reds for higher values. A set of alternate symbol colours can be provided by defining symcolr
...
further arguments to be passed to methods. For example, if it is required to make the plot title smaller, add cex.main = 0.9 to reduce the font size by 10%.

Details

The selected percentiles, 2nd, 5th, 25th, 50th, 75th, 95th and 98th, divide the data into 8 groups. Values below the median are represented by increasingly larger deeper blue circles below the 25th percentile (Q1), and values above the 75th percentile (Q3) by increasingly larger orange and red squares. The mid 50% of the data are represented by green symbols, circles for the median (Q2) to Q1, and squares for the median (Q2) to Q3. A summary table of the values of the symbol intervals, the number of values plotting as each symbol, and symbol shapes, sizes and colours is displayed on the current device. If zlab and main are undefined a default a plot title is generated by appending the input variable name text string to EDA Percentile Based Plot for. If no plot title is required set zlab = "", and if some user defined plot title is required it should be defined in main, e.g. main = "Plot Title Text". If the grey-scale option is chosen the symbols are plotted 100% black for the far outliers, 85% black for the near outliers, 70% black for values within the whiskers, and 60% black for values falling within the middle 50% of the data. The default colours, symcolr = c(25, 22, 20, 13, 13, 6, 4, 1), are selected from the rainbow(36) pallette, and alternate colour schemes need to be selected from the same palette. See display.rainbow for the available colours. It is essential that 8 colours be provided, e.g., symcolr = c(27, 24, 22, 12, 12, 5, 3, 36), if exactly 8 are not provided the default colours will be displayed.

See Also

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

Examples

Run this code
## Make test data available
data(sind)
attach(sind)

## Plot a default percentile display
xyplot.eda8(Fe, Mn, Zn)

## Plot with more appropriate axis scaling and labelling
## with a user specified title
xyplot.eda8(Fe, Mn, Zn, sfact = 2.0, log = "y",
	xlab = "Fe (pct) in stream sediment",
	ylab = "Mn (mg/kg) in stream sediment",
	main = "Howarth & Sinding-Larsen Test Data
Zn (mg/kg)") 

## Display a grey-scale equivalent of the above plot
xyplot.eda8(Fe, Mn, Zn, sfact = 2, log = "y", ifgrey = TRUE,
	xlab = "Fe (pct) in stream sediment",
	ylab = "Mn (mg/kg) in stream sediment",
	main = "Howarth & Sinding-Larsen Test Data
Zn (mg/kg)") 

## Plot the same display with an alternate colour scheme
xyplot.eda8(Fe, Mn, Zn, sfact = 2, log = "y",
	xlab = "Fe (pct) in stream sediment",
	ylab = "Mn (mg/kg) in stream sediment",
	main = "Howarth & Sinding-Larsen Test Data
Zn (mg/kg)",
	symcolr = c(27, 24, 22, 12, 12, 5, 3, 36)) 

## Detach test data
detach(sind)

Run the code above in your browser using DataLab