Plot a Symbol Map of Data Based on the Tukey Boxplot
Displays a simple map where the data are represented at their spatial locations by symbols using Tukey boxplot-based symbology. Tukey boxplots divide data into 7 groups, the middle 50%, and three lower and higher groupings, see Details below. The computation of the fences used to subdivide the data may be carried out following a logarithmic transformation of the data. The colours of the symbols may be optionally changed. Optionally a legend may be added to the map.
map.eda7(xx, yy, zz, sfact = 1, logz = FALSE, xlab = "Easting", ylab = "Northing", zlab = deparse(substitute(zz)), main = "", ifgrey = FALSE, symcolr = NULL, tol = 0.04, iflgnd = FALSE, title = deparse(substitute(zz)), cex.lgnd = 0.8, ...)
xx |
name of the x-axis spatial coordinate, the eastings. |
yy |
name of the y-axis spatial coordinate, the northings. |
zz |
name of the variable to be plotted. |
sfact |
controls the absolute size of the plotted symbols, by default |
xlab |
a title for the x-axis, defaults to |
ylab |
a title for the y-axis, defaults to |
zlab |
by default, |
main |
an alternative map title, see Details below. |
logz |
if it is required to undertake the Tukey Boxplot computations after a logarithmic data transform, set |
ifgrey |
set |
symcolr |
the default is a colour map 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 |
tol |
a parameter used to ensure the area included within the neatline around the map is larger than the distribution of the points so that the plotted symbols fall within the neatline. By default |
iflgnd |
the default is no legend. If a legend is required set |
title |
a short title for the legend, e.g., |
cex.lgnd |
controls the scaling of the legend box and text, but not the symbols so that they match those on the map, the default is |
... |
further arguments to be passed to methods. For example, if it is required to make the map title smaller, add |
Tukey boxplots divide data into 7 groups, the middle 50%, and three lower and higher groupings: within the whisker, near outliers and far outliers, respectively. Symbols for values below the first quartile (Q1) are plotted as increasingly larger circles, while symbols for values above the third quartile are plotted as increasingly larger squares, a ‘+’ is used to plot the data falling in the middle 50%. For the higher groupings, the whisker contains values >Q3 and <(Q3 + 1.5 * HW)
, where HW = (Q3 - Q1)
, the interquartile range; near outliers lie between (Q3 + 1.5 * HW)
and (Q3 + 3 * HW)
; and far outliers have values >(Q3 + 3 * HW)
. For the lower groupings the group boundaries, fences, fall similarly spaced below Q1. The computation of the fences used to subdivide the data may be carried out following a logarithmic transformation of the data, set logz = TRUE
.
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 map title is generated by appending the input variable name text string to "EDA Tukey Boxplot-Based Map for "
. If no map title is required set zlab = ""
, and if some user defined map title is required it should be defined in main
, e.g. main = "Map 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, 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 7 colours be provided, e.g., symcolr = c(27, 24, 22, 12, 5, 3, 36)
, if exactly 7 are not provided the default colours will be displayed.
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 ltdl.fix.df
.
Any data vectors including NA
s are removed prior to displaying the plot.
In some R installations the generation of multi-panel displays and the use of function eqscplot from package MASS causes warning messages related to graphics parameters to be displayed on the current device. These may be suppressed by entering options(warn = -1)
on the R command line, or that line may be included in a ‘first’ function prepared by the user that loads the ‘rgr’ package, etc.
Robert G. Garrett
## Make test data available data(kola.o) attach(kola.o) ## Plot a default symbol map map.eda7(UTME, UTMN, Cu) ## Plot with logarithmically scaled boxplot fences and more ## appropriate axis labelling map.eda7(UTME/1000, UTMN/1000, Cu, logz = TRUE, xlab = "Kola Project UTM Eastings (km)", ylab = "Kola Project UTM Northings (km)") ## Plot a grey-scale equivalent of the above map map.eda7(UTME/1000, UTMN/1000, Cu, logz = TRUE, ifgrey = TRUE, xlab = "Kola Project UTM Eastings (km)", ylab = "Kola Project UTM Northings (km)") ## Plot the same map with an alternate colour scheme map.eda7(UTME/1000, UTMN/1000, Cu, logz = TRUE, xlab = "Kola Project UTM Eastings (km)", ylab = "Kola Project UTM Northings (km)", symcolr = c(27, 24, 22, 12, 5, 3, 36)) ## Detach test data detach(kola.o)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.