ternary.grid(trifield)
ternary.grid()所属R语言包:trifield
Constructs a ternary grid
构造一个三元格
译者:生物统计家园网 机器人LoveR
描述----------Description----------
The function builds a rectangular lattice of points bounded by an equilateral triangle with unit altitude. It can be used with ternary.apply and ternary.field to create a surface of values for plotting.
这个函数建立与单元高度范围内的一个等边三角形的点的矩形点阵。它可以使用ternary.apply和ternary.field创建一个表面绘图的值。
用法----------Usage----------
ternary.grid(grid.size)
参数----------Arguments----------
参数:grid.size
The number of rows and columns in the grid
在网格中的行和列的数目
Details
详细信息----------Details----------
The size of the grid is the number of rows and colunn in the rectangular region bounding the ternary plot region. The number of output x, y and corresponding a, b, c points will be less than rows times columns because many x, y points fall outside the ternary region. In all cases, the sum of a, b and c will be unity.
网格的大小是在矩形区域中的边界的三元图区域的行和colunn的数目。输出x,y和对应的a,b,c点会低于行数乘以列,因为许多x, y点落在外三元区。在所有情况下,a的总和,b和c将是统一的。
值----------Value----------
Data frame with columns <table summary="R valueblock"> <tr valign="top"><td>x</td> <td> x-coordinate</td></tr> <tr valign="top"><td>y</td> <td> y-coordinate</td></tr> <tr valign="top"><td>xi</td> <td> column indices (I think)</td></tr> <tr valign="top"><td>yi</td> <td> row indices (I think)</td></tr> <tr valign="top"><td>a</td> <td> distance along first ternary axis</td></tr> <tr valign="top"><td>b</td> <td> distance along second ternary axis</td></tr> <tr valign="top"><td>c</td> <td> distance along third ternary axis</td></tr> </table>
数据框的列表summary="R valueblock"> <tr valign="top"> <TD>x </ TD> <TD> x坐标</ TD> </ TR> <TR VALIGN =“”> <TD>y</ TD> <TD> y坐标</ TD> </ TR> <tr valign="top"> <TD>xi</ TD > <TD>列索引(我认为)</ TD> </ TR> <tr valign="top"> <TD> yi </ TD> <TD>行索引(我认为)</ TD > </ TR> <tr valign="top"> <TD> a </ TD> <TD>沿第一三元轴的距离</ TD> </ TR> <tr valign="top"> < b TD> </ TD> <TD>第二三元轴的距离沿</ TD> </ TR> <tr valign="top"> <TD>c</ TD> <TD>第三三元轴沿的距离</ TD> </ TR> </ TABLE>
(作者)----------Author(s)----------
Tim Keitt <tkeitt@gmail.com>
参见----------See Also----------
link{ternary.apply}, link{ternary.grid}
link{ternary.apply},link{ternary.grid}
实例----------Examples----------
## The function is currently defined as[#功能目前被定义为]
function(grid.size)
{
lx = 2 / sqrt(3)
nx = trunc(lx * grid.size)
ny = grid.size
x = seq(0, lx, length = nx)
y = seq(0, 1, length = ny)
xy = as.matrix(expand.grid(x = x, y = y))
xyi = as.matrix(expand.grid(x = 1:nx, y = 1:ny))
abc = xy2abc(xy)
i = rowSums(abc < 0) == FALSE
abc = abc[i,]
xy = xy[i,]
xyi = xyi[i,]
res = data.frame(xy, xyi, abc)
names(res) = c('x', 'y', 'xi', 'yi', 'a', 'b', 'c')
res
}
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|