EqualAreaRectangularGrid: Equal-area grid from lines of longitude and latitude

Description Usage Arguments Details Value Author(s) Examples

View source: R/EqualAreaRectangularGrid.R

Description

Makes an equal-area grid of specified size from lines of longitude and latitude

Usage

1
EqualAreaRectangularGrid(N_longitude, N_latitude)

Arguments

N_longitude

Number of East-West bins.

N_latitude

Number of North-South bins.

Details

Nothing yet.

Value

The decimalised lines of longitude and latitude that describe the grid.

Author(s)

Graeme T. Lloyd graemetlloyd@gmail.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# Create a 20-by-10 (200 cell) grid:
grids <- EqualAreaRectangularGrid(N_longitude = 20, N_latitude = 10)

# View the output:
grids

# Visualise the output using a Mercator projection:
plot(0, 0, type = "n", xlim = c(-180, 180), ylim = c(-90, 90),
  xlab = "Longitude", ylab = "Latitude")
for(i in 1:length(grids$latitude_breaks)) 
  lines(c(-180, 180), c(grids$latitude_breaks[i], grids$latitude_breaks[i]), lty = 2)
for(i in 1:length(grids$longitude_breaks))
  lines(c(grids$longitude_breaks[i], grids$longitude_breaks[i]), c(-90, 90), lty = 2)

laurasoul/dispeRse documentation built on May 25, 2021, 4:50 a.m.