ternary.apply(trifield)
ternary.apply()所属R语言包:trifield
Apply a function over a ternary grid
应用的三元格内的函数
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Given 1) a ternary grid and 2) a function that takes a ternary value as its first argument, this function returns a vector formed by applying the function to each point in the grid.
1)三元格和2)一个函数,它接受一个三进制值作为第一个参数,这个函数返回一个矢量,由应用功能,在网格中的每个点。
用法----------Usage----------
ternary.apply(grid, f, ...)
参数----------Arguments----------
参数:grid
A data frame with columns a, b and c specifying points in a ternary field
一个数据框的列a,b和c指定点的三元领域
参数:f
A function that accepts a length 3 vector as its first argument
作为第一个参数的函数,它接受一个长度为3的向量
参数:...
Additional arguments passed to f
额外的参数传递给f
Details
详细信息----------Details----------
Results will be concatenated into a vector; it is most useful for scalar-valued functions.
结果将被连接成一个向量,它是最有用的标量值函数。
值----------Value----------
A vector of results
一个向量的结果
(作者)----------Author(s)----------
Tim Keitt <tkeitt@gmail.com>
参见----------See Also----------
ternary.field
ternary.field
实例----------Examples----------
## The function is currently defined as[#功能目前被定义为]
function(grid, f, ...)
{
f = match.fun(f)
abc = grid[,letters[1:3]]
g = function(i) f(abc[i,], ...)
unlist(lapply(1:nrow(grid), g))
}
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|