Learn R Programming

rgr (version 1.0.4)

edamap8: Plot a Symbol Map of Data Based on their Percentiles

Description

Displays a simple map where the data are represented at their spatial locations 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

edamap8(x, y, zz, sfact = 1, xlab = "Easting", ylab = "Northing", 
	zlab = deparse(substitute(zz)), main = "", ifgrey = FALSE,  
	symcolr = NULL, tol = 0.04)

Arguments

x
name of the x-axis spatial coordinate, the eastings.
y
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 sfact = 1. Increasing sfact results in larger symbols.
xlab
a title for the x-axis, defaults to Easting.
ylab
a title for the y-axis, defaults to Northing.
zlab
by default, zlab = deparse(substitute(zz)), a map title is generated by appending the input variable name text string to EDA Percentile Based Map for. Alternative titles may be generated, see Details below.
main
an alternative map title, see Details below.
ifgrey
set ifgrey = TRUE if a grey-scale map is required, see Details below.
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 symcol, s
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 tol = 0.04, if more clearance is required increase

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 map title is generated by appending the input variable name text string to EDA Percentile 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, 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(kola.o)
attach(kola.o)

## Plot a default symbol map
edamap8(UTME, UTMN, Cu)

## Plot a more appropriately labelled map
edamap8(UTME/1000, UTMN/1000, Cu, 
	xlab = "Kola Project UTM Eastings (km)",
	ylab = "Kola Project UTM Northings (km)") 

## Plot a grey-scale equivalent of the above map
edamap8(UTME/1000, UTMN/1000, Cu, ifgrey = TRUE,
	xlab = "Kola Project UTM Eastings (km)",
	ylab = "Kola Project UTM Northings (km)") 

## Plot the same map with an alternate colour scheme
edamap8(UTME/1000, UTMN/1000, Cu,
	xlab = "Kola Project UTM Eastings (km)",
	ylab = "Kola Project UTM Northings (km)",
	symcolr = c(27, 24, 22, 12,12, 5, 3, 36)) 

## Detach test data
detach(kola.o)

Run the code above in your browser using DataLab