ConnCompLabel(SDMTools)
ConnCompLabel()所属R语言包:SDMTools
Connected Components Labelling – Unique Patch Labelling
连接组件标签 - 独特的补丁标签
译者:生物统计家园网 机器人LoveR
描述----------Description----------
ConnCompLabel is a 1 pass implementation of connected components labelling. Here it is applied to identify disjunt patches within a distribution. <br> <br> The raster matrix can be a raster of class 'asc' (adehabitat package), 'RasterLayer' (raster package) or 'SpatialGridDataFrame' (sp package).
ConnCompLabel是一个通过实施连接的组件标签。在这里,它被施加到识别disjunt修补程序内的分布。栅格<br> <br>该基体可以是类的递增(adehabitat包)的一个光栅,的RasterLayer(栅格包)或的SpatialGridDataFrame(藻包)。
用法----------Usage----------
ConnCompLabel(mat)
参数----------Arguments----------
参数:mat
is a binary matrix of data with 0 representing background and 1 representing environment of interest. NA values are acceptable. The matrix can be a raster of class 'asc' (this & adehabitat package), 'RasterLayer' (raster package) or 'SpatialGridDataFrame' (sp package) </table>
是一个二进制0表示背景和1表示感兴趣的环境数据与矩阵。 NA值是可以接受的。该矩阵可以是一个栅格类递增(这&adehabitat包),RasterLayer(光栅包)或SpatialGridDataFrame(藻包)</表>
值----------Value----------
A matrix of the same dim and class of mat in which unique components (individual patches) are numbered 1:n with 0 remaining background value.
矩阵相同的暗淡和类mat独特的组件(单个修补程序)的编号为1:n的0其余的背景值。
(作者)----------Author(s)----------
Jeremy VanDerWal <a href="mailto:jjvanderwal@gmail.com">jjvanderwal@gmail.com</a>
参考文献----------References----------
<h3>See Also</h3>
实例----------Examples----------
#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)))
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|