make.multigrid {mapplots} | R Documentation |
Create a grd object
Description
Create list of grd objects from x
, y
, z
and group
data, where each level of group
provides a separate grd object. For use with draw.grid
.
Usage
make.multigrid(x, y, z, group, ...)
Arguments
x |
a vector of x-coordinates (longitude) |
y |
a vector of y-coordinates (latitude; same length as |
z |
a vector of values; same length as |
group |
a factor; same length as |
... |
other arguments to be passed to |
Value
a list of grd objects, see make.grid
.
Author(s)
Hans Gerritsen
See Also
Examples
data(coast)
data(landings)
byx = 1
byy = 0.5
xlim <- c(-12.5,-5)
ylim <- c(50.25,56)
grd <- make.multigrid(landings$Lon,landings$Lat,landings$LiveWeight, landings$Species,
byx, byy, xlim, ylim)
breaks <- breaks.grid(grd,zero=FALSE)
par(mfrow=c(2,3),mar=c(1,1,2,1) )
for(s in names(grd) ) {
basemap(xlim, ylim, main = s, axes=FALSE)
draw.grid(grd[[s]],breaks)
draw.shape(coast, col="darkgreen")
}
plot.new()
legend.grid("center",breaks=breaks/1000,type=2)
[Package mapplots version 1.5.2 Index]