grid.area: Create a Grid of Cell Areas or Perimeters

Description Usage Arguments Value Author(s) Examples

View source: R/grid.area.R

Description

Creates a grid of cell areas or perimeters for spatial grids in geographic (lat-lon) projections.

Usage

1
2
3

Arguments

mat

a matrix representing a raster of class 'asc' (this & adehabitat package), 'RasterLayer' (raster package) or 'SpatialGridDataFrame' (sp package)

Value

grid.area

Returns an ascii grid file which contains the values of the area in each cell.

grid.perimter

Returns an ascii grid file which contains the values of the perimeter in each cell.

Author(s)

Jeremy VanDerWal jjvanderwal@gmail.com & Lorena Falconi lorefalconi@gmail.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
#Create an ascii file
y=seq(10,50,0.5)
x=seq(140,180,0.5)
cellsize=0.5
data1=sample(160,140)
out1.asc=as.asc(matrix(data1,nc=y, nr=x), xll=min(x), yll=min(y), cellsize=cellsize)

grid.area(out1.asc)[,]

grid.perimeter(out1.asc)[,]

SDMTools documentation built on Jan. 11, 2020, 9:23 a.m.

Related to grid.area in SDMTools...