make.multigrid: Create a grd object

View source: R/make.multigrid.R

make.multigridR 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 x)

z

a vector of values; same length as x

group

a factor; same length as x. E.g. species, season etc.

...

other arguments to be passed to make.grid.

Value

a list of grd objects, see make.grid.

Author(s)

Hans Gerritsen

See Also

make.grid, draw.grid

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)

mapplots documentation built on Aug. 25, 2023, 5:15 p.m.