Description Usage Arguments Details Value Author(s) References See Also Examples
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).
1 |
mat |
a matrix of data with individual patches
identified as with |
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' |
The patch statistics are based on statistics calculated by fragstats http://www.umass.edu/landeco/research/fragstats/fragstats.html.
a data.frame listing
patchID |
the unique ID for each patch. |
n.cell |
the number of cells for each patch, specified in square meters. |
n.core.cell |
the number of cells in the core area, without the edge area. |
n.edges.perimeter |
the number of outer perimeter cell edges of the patch. |
n.edges.internal |
the number of internal cell edges of the patch. |
area |
the area of each patch comprising a landscape mosaic. |
core.area |
represents the interior area of the patch, greater than the specified depth-of-edge distance from the perimeter. |
perimeter |
the perimeter of the patch, including any internal holes in the patch, specified in meters. |
perim.area.ratio |
the ratio of the patch perimeter (m) to area (m2). |
shape.index |
the shape complexity, sum of each patches perimeter divided by the square root of patch area. |
frac.dim.index |
fractal 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.index |
quantifies core area as a percentage of patch area. |
Jeremy VanDerWal jjvanderwal@gmail.com
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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | #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
|
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 0 0 0 1 0 0 2 2 0 3
[2,] 0 0 1 0 1 0 0 0 0 0
[3,] 0 1 NA 1 0 1 0 0 0 4
[4,] 1 0 1 1 1 0 1 0 0 4
[5,] 0 1 0 1 0 1 0 0 0 4
[6,] 0 0 1 0 1 0 0 4 4 0
[7,] 4 0 0 1 0 0 4 0 0 4
[8,] 0 4 0 0 0 4 0 0 0 4
[9,] 0 0 4 4 4 0 0 0 0 4
[10,] 4 4 4 0 0 0 0 0 0 4
patchID n.cell n.core.cell n.edges.perimeter n.edges.internal area core.area
1 0 60 1 122 118 60 1
2 1 17 0 60 8 17 0
3 2 2 0 6 2 2 0
4 3 1 0 4 0 1 0
5 4 19 0 54 22 19 0
perimeter perim.area.ratio shape.index frac.dim.index core.area.index
1 122 2.033333 3.812500 1.669487 0.01666667
2 60 3.529412 3.333333 1.911646 0.00000000
3 6 3.000000 1.000000 1.169925 0.00000000
4 4 4.000000 1.000000 NaN 0.00000000
5 54 2.842105 3.000000 1.767868 0.00000000
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.