points.geodata {geoR}R Documentation

Plots Spatial Locations and Data Values

Description

This function produces a plot with points indicating the data locations. Arguments can control the points sizes, patterns and colors. These can be set to be proportional to data values, ranks or quantiles. Alternatively, points can be added to the current plot.

Usage

points.geodata(geodata, coords=geodata$coords, data=geodata$data,
               data.col = 1, borders = NULL,
               pt.sizes=c("data.proportional","rank.proportional",
                    "quintiles", "quartiles", "deciles", "equal"),
               cex.min, cex.max, pch.seq, col.seq,
               add.to.plot = FALSE,
               round.quantiles = FALSE, graph.pars = FALSE, ...)

Arguments

geodata a list containing elements coords and data described next. Typically an object of the class "geodata" - a geoR data-set. If not provided the arguments coords and data must be provided instead.
coords an n x 2 matrix containing coordinates of the n data locations in each row. Defaults to geodata$coords.
data a vector or matrix with data values. If a matrix is provided each column is regarded as one variable or realization. Defaults to geodata$data.
data.col the number of the data column. Only used if data is a matrix with columns corresponding to different variables or simulations.
borders adds the border of the area if an nx2 matrix or data-frame with the coordinates of the borders of the regions is provided.
pt.sizes defines the point sizes. See DETAILS below for the available options. Defaults to pt.sizes = "data.proportional".
cex.min minimum value for the graphical parameter cex. This value defines the size of the point corresponding the minimum of the data. Defaults to 0.5.
cex.max maximum value for the graphical parameter cex. This value defines the size of the point corresponding the maximum of the data. If pt.sizes = "equal" it is used to set the value for the graphical parameter cex. Defaults to 1.5.
pch.seq number(s) defining the graphical parameter pch.
col.seq number(s) defining the colors in the graphical parameter col.
add.to.plot logical. If TRUE the points are added to the current plot otherwise a new plot is created. Defaults to FALSE.
round.quantiles logical. Defines whether or not the values of the quantiles should be rounded. Defaults to FALSE.
graph.pars logical. If TRUE the graphics parameters used to produce the plots are returned. Defaults to FALSE.
... further arguments to be passed to the function plot, if add.to.plot = FALSE; or to the function points, if add.to.plot = TRUE.

Details

The points can have different sizes according to the argument pt.sizes. The options are:

"data.proportional"
sizes proportional to the data values.
"rank.proportional"
sizes proportional to the rank of the data.
"quintiles"
five different sizes according to the quintiles of the data.
"quartiles"
four different sizes according to the quartiles of the data.
"deciles"
ten different sizes according to the deciles of the data.
"equal"
all points with the same size.

For cases where points have different sizes the arguments cex.min and cex.max set the minimum and the maximum point sizes. Additionally, pch.seq can set different patterns for the points and col.seq can be used to define colors. For example, different colors can be used for quartiles, quintiles and deciles while a sequence of gray tones (or a color sequence) can be used for point sizes proportional to the data or their ranks. For more details see the section EXAMPLES.

Value

A plot is created or points are added to the current graphics device.
By default no value is returned. However, if graph.pars = TRUE a list with graphical parameters used to produce the plot is returned. According to the input options, the list has some or all of the following components:

quantiles the values of the quantiles used to divide the data.
cex the values of the graphics expansion parameter cex.
col the values of the graphics color parameter col.
pch the values of the graphics pattern parameter pch.

Author(s)

Paulo J. Ribeiro Jr. Paulo.Ribeiro@est.ufpr.br,
Peter J. Diggle p.diggle@lancaster.ac.uk.

References

Further information about geoR can be found at:
http://www.maths.lancs.ac.uk/~ribeiro/geoR.html.

See Also

plot.geodata for another display of the data and points and plot for information on the generic R functions. The documentation of par provides details on graphical parameters. For color schemes in R see gray and rainbow.

Examples

if(is.R()) data(s100)
op <- par(no.readonly = TRUE)
par(mfrow=c(2,2))
par(mar=c(3,3,1,1))
par(mgp = c(2,1,0))
points(s100, xlab="Coord X", ylab="Coord Y")
points(s100, xlab="Coord X", ylab="Coord Y", pt.size="rank.prop")
points(s100, xlab="Coord X", ylab="Coord Y", cex.max=1.7,
               col=gray(seq(1, 0.1, l=100)), pt.siz="equal")
               # the function gray() works only for R
points(s100, pt.sizes="quintile", xlab="Coord X",
               ylab="Coord Y")
par(op)