Learn R Programming

geoR (version 1.9-4)

plot.geodata: Exploratory Geostatistical Plots

Description

This function produces a \(2 \times 2\) display with the following plots: the first indicates the spatial locations assign different colors to data in different quartiles, the next two shows data against the X and Y coordinates and the last is an histogram of the data values or optionally, a 3-D plot with spatial locations and associated data values.

Usage

# S3 method for geodata
plot(x, coords=x$coords, data = x$data,
             borders, trend="cte", lambda = 1, col.data = 1,
             weights.divide = "units.m", lowess = FALSE, scatter3d = FALSE,
             density = TRUE, rug = TRUE, qt.col, ...)

Value

A plot is produced on the graphics device. No values are returned.

Arguments

x

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 \times 2\) matrix containing in each row Euclidean coordinates of the n data locations. By default it takes the element coords of the argument geodata.

data

a vector with data values. By default it takes the element data of the argument geodata.

borders

If an \(n \times 2\) matrix or data-frame with the borders of the area is provided, the borders are included in the first plot. By default it searches for a element named "borders" in the geodata object.

trend

specifies the mean part of the model. The options are: "cte" (constant mean - default option), "1st" (a first order polynomial on the coordinates), "2nd" (a second order polynomial on the coordinates), or a formula of the type ~X where X is a matrix with the covariates (external trend). If provided the trend is "removed" using the function lm and the residuals are plotted.

lambda

value of the Box-Cox transformation parameter. Two particular cases are \(\lambda = 1\) which corresponds to no transformation and \(\lambda = 0\) corresponding to the log-transformation.

col.data

indicates the column number for the data to be plotted. Only valid if more than one data-set is available i.e., if the argument data is a matrix.

weights.divide

if a vector of weights with the same length as the data is provided each data is divided by the corresponding element in this vector. Defaults divides the data by the element units.m in the data object, if present, otherwise no action is taken and original data is used. The usage of units.m is common for data objects to be analysed using the package geoRglm.

lowess

logical. Indicates whether the function lowess should be used in the plots of the data against the coordinates.

scatter3d

logical. If TRUE the last plot is produced by scatterplot3d showing a 3d plot with data locations and corresponding values.

density

logical. If TRUE (default) a line with density estimation is added to the histogram.

rug

logical. If TRUE a rug plot is added to the histogram.

qt.col

colors for the quartiles in the first plot. If missing defaults to blue, green, yellow and red.

...

further arguments to be passed to the function hist or scatterplot3d.

Author

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

References

Further information on the package geoR can be found at:
http://www.leg.ufpr.br/geoR/.

See Also

points.geodata, scatterplot3d, lowess, density, rug.

Examples

Run this code
require(geoR)
plot(s100)
plot(s100, scatter3d=TRUE)
plot(s100, qt.col=1)

plot(ca20)                       # original data
plot(ca20, trend=~altitude+area) # residuals from an external trend
plot(ca20, trend='1st')          # residuals from a polynomial trend

plot(sic.100, bor=sic.borders)           # original data
plot(sic.100, bor=sic.borders, lambda=0) # logarithm of the data

Run the code above in your browser using DataLab