Learn R Programming

mapplots (version 1.5.2)

ices.rect: Convert ICES rectangles from or to geographical coordinates

Description

ices.rect converts the names of ICES statistical rectangles into geographical coordinates (midpoints). ices.rect2 converts geographical coordinates into ICES statistical rectangles.

Usage

ices.rect(rectangle)
ices.rect2(lon, lat)

Value

ices.rect will return a data frame with the midpoints of the ICES rectangles. ices.rect2 will return a vector with the names of the ICES rectangles.

Arguments

rectangle

a characer vector with the names of ices rectangles. Note that the code can cope with rectangle names that have been converted into numbers by helpful microsoft office software, e.g. "36E2" tends to be converted to 3600.

lon, lat

a vector with longitude and latitude (not neccesarily the mid-points of rectangles).

Author

Hans Gerritsen

References

ICES statistical rectangles https://www.ices.dk are rectangles of 1 degree longitude x 0.5 degrees latitude. They are used for reporting of fishinge effort and landings.

Examples

Run this code
# rectangle names to coordinates:
ices.rect(c("36E2","3600","40D8"))

# coordinates to rectangle names:
lon <- rnorm(10,-10,2)
lat <- rnorm(10,53,1)
rect <- ices.rect2(lon,lat)
basemap(xlim=range(lon), ylim=range(lat) )
draw.rect()
points(lon,lat)
text(lon,lat,rect,cex=0.7,pos=3)

Run the code above in your browser using DataLab