Learn R Programming

rgr (version 1.0.4)

edamap: Plot a Map of Data using Proportional Symbols

Description

Displays a simple map where the data are represented by open circles whose diameters are proportional to the value of the data at their spatial locations. The rate of change of symbol diameter with value and the absolute size of the symbols are defined by the user.

Usage

edamap(x, y, zz, p = 1, sfact = 1, zmin = NA, zmax = NA, 
	xlab = "Easting", ylab = "Northing",
	zlab = deparse(substitute(zz)), main = "", 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.
p
a parameter that controls the rate of change of symbol diameter with changing value. A default of p = 1 is provided that results in a linear rate of change. See Details below.
sfact
controls the absolute size of the plotted symbols, by default sfact = 1. Increasing sfact results in larger symbols.
zmin
a value below which all symbols will be plotted at the same minumum size. By default zmin = NA which results in the minimum value of the variable defining the minimum symbol size. See Details below.
zmax
a value above which all symbols will be plotted at the same maximum size. By default zmax = NA which results in the maximum value of the variable defining the maximum symbol size. See Details below.
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 Proportional Symbol Map for. Alternative titles may be generated, see Details below.
main
an alternative map title, see Details below.
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 symbol diameter is computed as a function of the value z to be plotted: diameter = dmin + (dmax - dmin) * {(z - zmin)/(zmax - zmin)}^p where dmin and dmax are defined as 0.1 and 1 units, so the symbol diameters range over an order of magnitude (and symbol areas over two); zmin and zmax are the observed range of the data, or the range over which the user wants the diameters to be computed; and p is a power defined by the user. The value of (z - zmin)/(zmax - zmin) is the value of z normalized, 0 - 1, to the range over which the symbol diameters are to be computed. After being raised to the power p, which will result in number in the range 0 to 1, this value is multiplied by the permissable range of diameters and added to the minimum diameter. This results in a diameter between 0.1 and 1 units that is proportional to the value of z. A p value of 1 results in a linear rate of change. Values of p less than unity lead to a rapid intial rate of change with increasing value of z which is often suitable for displaying positively skewed data sets, see the example below. In contrast, values of p greater than unity result in an initial slow rate of change with increasing value of z which is often suitable for displaying negatively skewed data sets. Experimentation is usually necessary to obtain a satisfactory visual effect. See syms.pfunc for a graphic demonstrating the effect of varying the p parameter. The user may choose to transform the variable to be plotted prior to determining symbol size etc., e.g. log10(zz), to generate a logarithmic rate of symbol size change. See Example below. If zmin or zmax are defined this has the effect of setting a minimum or maximum value of z, respectively, beyond which changes in the value of z do not result in changes in symbol diameter. This can be useful in limiting the effect of one or a few extreme outliers while still plotting them, they simply plot at the minimum or maximum symbol size and are not involved in the calculation of the range of z over which the diameter varies. If zlab and main are undefined a default a map title is generated by appending the input variable name text string to "Proportional Symbol 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".

See Also

syms, syms.pfunc, ltdl.fix.df, remove.na

Examples

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

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

## Plot a differently symbol scaled and more appropriately labelled 
## map
edamap(UTME/1000, UTMN/1000, Cu, p = 0.3, sfact = 2.0,
	xlab = "Kola Project UTM Eastings (km)",
	ylab = "Kola Project UTM Northings (km)" ) 

## Plot a map as above but where outliers above a value of 1000 are
## displayed with the same symbol
edamap(UTME/1000, UTMN/1000, Cu, p = 0.3, sfact = 2.0, zmax = 1000,
	xlab = "Kola Project UTM Eastings (km)",
	ylab = "Kola Project UTM Northings (km)" )

## plot a map where the symbols are logarithmically scaled
edamap(UTME/1000, UTMN/1000, log10(Cu), sfact = 2.0,
	xlab = "Kola Project UTM Eastings (km)",
	ylab = "Kola Project UTM Northings (km)" )

## Detach test data
detach(kola.o)

Run the code above in your browser using DataLab