Learn R Programming

geo (version 1.4-3)

rGrid: Produce a grid of rectangles on a plot, filled with colors if desired.

Description

Functions that plot a line grid or one filled with colors for rectangle codes in systems of various resolutions with call to geolines or geopolygon and perimeter utility functions (see rectPeri).

Usage

rgrid(r, fill = FALSE, ...)
srgrid(sr, fill = FALSE, ...)
mrgrid(mr, dlat = 5, dlon = 10, fill = FALSE, ...)
drgrid(dr, dlat = 1, dlon = 2, fill = FALSE, ...)

Arguments

r,sr,dr,mr
Codes of rectangle to be outlined or filled. In different resolutions, r, sr with their own system (see deg2rect), mr dimensions based on minutes, dr on degrees.
fill
Logical, whether or not to fill the plotted rectangles.
dlat,dlon
Dimensions of latitude and longitude given in minutes and degrees for mrgrid and drgrid, respectively
...
other arguments to geopolygon or geolines as appropriate, notably col.

Value

No values returned, used for side-effects.

Details

The functions simply outline or fill the rectangles they are given. whereas reitaplott and geoSR assume levels and are more hi-level.

See Also

deg2rect, geolines, geopolygon, rectPeri, reitaplott, geoSR.

Examples

Run this code
geoplot(grid = FALSE)
tmp <- island
tmp$sr <- d2sr(island)
srects <- aggregate(. ~ sr, tmp, length)
names(srects)[2] <- "count"
srects$lev <- cut(srects$count, c(0, 1, 5, 10, 20, 50, 100))
mycol <- heat.colors(length(unique(srects$lev)))
srgrid(srects$sr, fill = TRUE, col = mycol[srects$lev])
geolines(island)

Run the code above in your browser using DataLab