ternary.field(trifield)
ternary.field()所属R语言包:trifield
Constructs a ternary field
构造一个三元领域
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Constructs a trifield object, suitable for use with image and contour from a ternary grid
构造一个trifield对象,适合使用image和contour的三元格
用法----------Usage----------
ternary.field(grid, vals, dim.out = NULL)
参数----------Arguments----------
参数:grid
A ternary grid as returned e.g. by the ternary.grid function
三元格返回例如ternary.grid功能
参数:vals
A vector of values where length(vals) == nrow(grid) as returned e.g. by the ternary.apply function
length(vals) == nrow(grid)返回例如一个向量的值ternary.apply功能
参数:dim.out
Dimensions (rows and columns) of the output
尺寸(行和列)的输出
Details
详细信息----------Details----------
This function constructs a trifield object suitable for plotting. It may be the case that the dimension indices contained in the ternary grid object may not contain sufficient information to determine the dimensions of the output. In that case, explicit output dimensions can be provided using the dim.out argument. If the dim.out argument is NULL, then the maximum row and column indices (xi, yi) will be extracted from the ternary grid. Note that image plots the transposition of input matrices and that dim.out must be specified with this in mind.
此功能构建了一个trifield适合用于绘制对象。它可能是三元栅格对象中包含的的尺寸指数的情况下,可能不包含足够的信息,以确定输出的尺寸。在这种情况下,可以提供使用明确的输出尺寸dim.out参数。如果dim.out的说法是NULL,那么最大的行和列(xi,yi)将提取的三元格。需要注意的是image图的换位输入矩阵和dim.out必须指定这一点。
值----------Value----------
A list with x, y and z elements defining a plotting surface suitable for use with image and contour.
列表x,y和z元素定义一个适合image和contour使用的绘图表面。
(作者)----------Author(s)----------
Tim Keitt <tkeitt@gmail.com
参见----------See Also----------
ternary.grid, image.default
ternary.grid,image.default
实例----------Examples----------
## The function is currently defined as[#功能目前被定义为]
ternary.field = function(grid, vals, dim.out = NULL)
{
with(grid,
{
if ( is.null(dim.out) ) dim.out = c(max(xi), max(yi))
q = array(NA, dim = dim.out)
q[cbind(xi, yi)] = vals
x.out = seq(0, 2 / sqrt(3), length = dim.out[1])
y.out = seq(0, 1, length = dim.out[2])
res = list(x = x.out, y = y.out, z = q)
class(res) = "trifield"
return(res)
})
}
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|