Create a grd object

Share:

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

1

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
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)