deg2grid | R Documentation |
Functions to assign a grid label(s) given coordinates, and vice versa.
deg2grid(
x,
y,
quarter.grid = FALSE,
xref = -66 - 1/3,
yref = 45,
dx = 1/6,
dy = 1/6,
reference = "HP23"
)
grid2deg(
x,
xref = -66 - 1/3,
yref = 45,
dx = 1/6,
dy = 1/6,
reference = "HP23",
vertices = FALSE
)
grid.scs(x, ...)
x , y |
Coordinate vectors (e.g. decimal longitude or latitude) or grid name. |
quarter.grid |
A logical value specifying whether the grid is to include northing and easting qualifiers. |
xref , yref |
Numerical values specifying the horizontal and vertical reference coordinates. Reference coordinates specify the location of the the lower-left corner of reference grid. |
dx , dy |
Numerical values specifying the width or height of each grid. |
reference |
A four-character string of the form XXYY, where XX are two letters and YY are two digits. |
longitude , latitude |
Vector of decimal longitude or latitude. |
deg2grid()
: Returns a grid name for a given coordinate(s).
grid2deg()
: Returns the corner coordinates of a grid.
grid.scs()
: Generic method for identifying a grid from the snow crab survey spatial design.
plot.grid
deg2grid(-64, 47) # Returns "HD37".
grid2deg("HD37") # Return corner coordinates for "HD37".
grid2deg("HD37", vertices = TRUE) # Return vertex coordinates for "HD37".
# Generate 100 random coordinates:
lon <- -66 + 6 * runif(100)
lat <- 45 + 4 * runif(100)
deg2grid(lon, lat)
# Single point:
grid.scs(-63, 47.5)
# Vector of points:
s <- read.scsset(2020)
grid.scs(lon(s), lat(s))
grid.scs(s) # Apply directly.
# Return survey grid definitions:
grid.scs()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.