Plot a Map of Posted Values

Share:

Description

Displays a simple map where the data are represented by the ‘written’ values of the data at their spatial locations.

Usage

1
2
map.tags(xx, yy, tag, xlab = "Easting", ylab = "Northing",
	taglab = deparse(substitute(tag)), main = "", tol = 0.04, ...)

Arguments

xx

name of the x-axis spatial coordinate, the eastings.

yy

name of the y-axis spatial coordinate, the northings.

tag

name of the variable to be plotted as a map.

xlab

a title for the x-axis, defaults to Easting.

ylab

a title for the y-axis, defaults to Northing.

taglab

by default, taglab = deparse(substitute(tag)), a map title is generated by appending the input variable name text string to "Map of Values 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 the value of tol.

...

further arguments to be passed to methods. For example, if smaller plotting characters are required, specify cex = 0.8; or if some colour other than black is required for the plotting characters, specify col = 2 to obtain red (see display.lty for the default colour palette). If it is required to make the map title smaller, add cex.main = 0.9 to reduce the font size by 10%.

Details

If taglab and main are undefined a default a map title is generated by appending the input variable name text string to "Map of Values for ". If no map title is required set taglab = "", or if an alternative to the variable name taglab is required it may be specified, taglab = "Alternative". If some user defined map title is required it should be defined in main, e.g. main = "Map Title Text", in which instance taglab is ignored.

If a map of sample numbers, ‘IDs’, is required and they are not explicitly in the data frame, a map of data frame row numbers may be displayed by specifying dimnames(dfname)[[1]] as the value of tags.

Note

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 NAs for spatial coordinates are removed prior to displaying the map, thus those ‘sites’ are not plotted. However, where coordinates are present any NAs in the variable to be plotted are replaced with a ‘+’ sign to indicate sites with ‘missing data’.

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.

Author(s)

Robert G. Garrett

See Also

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

Examples

 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
## Make test data available
data(sind)
attach(sind)

## Plot a sample site number map
map.tags(E, N, ID)

## Plot a sample site number map with smaller numbers
## and a wider internal map margin
map.tags(E, N, ID, cex = 0.8, tol = 0.06)

## Plot the data frame row numbers rather than the sample
## numbers
map.tags(E, N, dimnames(sind)[[1]], cex = 0.8, tol = 0.06)

## Plot the values for Zn in red, providing enough internal
## map margin so the values do not overprint the map neat-line
map.tags(E, N, Zn, cex = 0.8, tol = 0.1, col = 2)

## Plot as above but with an informative title spread over
## two lines and with a slightly smaller font
map.tags(E, N, Zn, cex = 0.8, tol = 0.1, col = 2, main =
	"Howarth & Sinding-Larsen\nStream Sediment Zn Data",
	cex.main = 0.9) 

## Detach test data
detach(sind) 

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.