by.im(spatstat)
by.im()所属R语言包:spatstat
Apply Function to Image Broken Down by Factor
应用功能细分因素的图片
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Splits a pixel image into sub-images and applies a function to each sub-image.
拆分成子图像的像素的图像,每个子图像应用一个函数。
用法----------Usage----------
## S3 method for class 'im'
by(data, INDICES, FUN, ...)
参数----------Arguments----------
参数:data
A pixel image (object of class "im").
像素的图像(类的对象"im"“)。
参数:INDICES
Grouping variable. Either a tessellation (object of class "tess") or a factor-valued pixel image.
分组变量。无论是镶嵌(对象类"tess")或因子值的像素图像。
参数:FUN
Function to be applied to each sub-image of data.
功能被应用到每个子图像的data。
参数:...
Extra arguments passed to FUN.
额外的参数传递给FUN。
Details
详细信息----------Details----------
This is a method for the generic function by for pixel images (class "im").
这是一个方法的通用函数by像素的图像(类"im")。
The pixel image data is first divided into sub-images according to INDICES. Then the function FUN is applied to each subset. The results of each computation are returned in a list.
像素的图像data首先被划分成子图像,根据INDICES。然后,该功能FUN被施加到每个子集。返回列表中的每个计算的结果。
The grouping variable INDICES may be either
分组变量INDICES可能是
a tessellation (object of class "tess"). Each tile of the tessellation delineates a subset of the spatial domain.
镶嵌(类的对象"tess")。每一瓦片的镶嵌描绘的空间域的一个子集。
a pixel image (object of class "im") with factor values. The levels of the factor determine subsets of the spatial domain.
像素的图像(类的对象"im")因子值。因子的水平确定的空间域的子集。
值----------Value----------
A list containing the results of each evaluation of FUN.
一个列表,其中包含的FUN每个评价的结果。
(作者)----------Author(s)----------
Adrian Baddeley
<a href="mailto:Adrian.Baddeley@csiro.au">Adrian.Baddeley@csiro.au</a>
<a href="http://www.maths.uwa.edu.au/~adrian/">http://www.maths.uwa.edu.au/~adrian/</a>
and Rolf Turner
<a href="mailto:r.turner@auckland.ac.nz">r.turner@auckland.ac.nz</a>
参见----------See Also----------
split.im, tess, im
split.im,tess,im
实例----------Examples----------
W <- square(1)
X <- as.im(function(x,y){sqrt(x^2+y^2)}, W)
Y <- dirichlet(runifpoint(12, W))
# mean pixel value in each subset[在每个子集的平均像素值]
unlist(by(X, Y, mean))
# trimmed mean[截尾均值]
unlist(by(X, Y, mean, trim=0.05))
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|