Learn R Programming

SDMTools (version 1.1-11)

PatchStat: Landscape Patch Statistics

Description

PatchStat calculates the patch statistics for individual patches identified in a matrix of data. The matrix can be a raster of class 'asc' (adehabitat package), 'RasterLayer' (raster package) or 'SpatialGridDataFrame' (sp package).

Usage

PatchStat(mat,cellsize=1,latlon=FALSE)

Arguments

mat
a matrix of data with individual patches identified as with ConnCompLabel; The matrix can be a raster of class 'asc' (this & adehabitat package), 'RasterLayer' (raster package) or 'SpatialGridDataFrame' (sp package)
cellsize
cell size (in meters) is a single value representing the width/height of cell edges (assuming square cells)
latlon
boolean value representing if the data is geographic. If latlon == TRUE, matrix must be of class 'asc', 'RasterLayer' or 'SpatialGridDataFrame'

Value

  • a data.frame listing
  • patchIDthe unique ID for each patch.
  • n.cellthe number of cells for each patch, specified in square meters.
  • n.core.cellthe number of cells in the core area, without the edge area.
  • n.edges.perimeterthe number of outer perimeter cell edges of the patch.
  • n.edges.internalthe number of internal cell edges of the patch.
  • areathe area of each patch comprising a landscape mosaic.
  • core.arearepresents the interior area of the patch, greater than the specified depth-of-edge distance from the perimeter.
  • perimeterthe perimeter of the patch, including any internal holes in the patch, specified in meters.
  • perim.area.ratiothe ratio of the patch perimeter (m) to area (m2).
  • shape.indexthe shape complexity, sum of each patches perimeter divided by the square root of patch area.
  • frac.dim.indexfractal dimension index reflects shape complexity across a range of spatial scales; approaches 2 times the logarithm of patch perimeter (m) divided by the logarithm of patch area (m2).
  • core.area.indexquantifies core area as a percentage of patch area.

Details

The patch statistics are based on statistics calculated by fragstats http://www.umass.edu/landeco/research/fragstats/fragstats.html.

References

McGarigal, K., S. A. Cushman, M. C. Neel, and E. Ene. 2002. FRAGSTATS: Spatial Pattern Analysis Program for Categorical Maps. Computer software program produced by the authors at the University of Massachusetts, Amherst. Available at the following web site: www.umass.edu/landeco/research/fragstats/fragstats.html

See Also

ClassStat, ConnCompLabel

Examples

Run this code
#define a simple binary matrix
tmat = { matrix(c( 0,0,0,1,0,0,1,1,0,1,
                   0,0,1,0,1,0,0,0,0,0,
                   0,1,NA,1,0,1,0,0,0,1,
                   1,0,1,1,1,0,1,0,0,1,
                   0,1,0,1,0,1,0,0,0,1,
                   0,0,1,0,1,0,0,1,1,0,
                   1,0,0,1,0,0,1,0,0,1,
                   0,1,0,0,0,1,0,0,0,1,
                   0,0,1,1,1,0,0,0,0,1,
                   1,1,1,0,0,0,0,0,0,1),nr=10,byrow=TRUE) }
					
#do the connected component labelling
ccl.mat = ConnCompLabel(tmat)
ccl.mat
image(t(ccl.mat[10:1,]),col=c('grey',rainbow(length(unique(ccl.mat))-1)))

#calculate the patch statistics
ps.data = PatchStat(ccl.mat)
ps.data

Run the code above in your browser using DataLab