找回密码
 注册
查看: 318|回复: 0

R语言 spBayes包 hexGrid()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-30 14:23:18 | 显示全部楼层 |阅读模式
hexGrid(spBayes)
hexGrid()所属R语言包:spBayes

                                        Generates a hexagon tessellation within a bounding box
                                         生成一个六边形镶嵌在包围盒

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

This function generates a hexagon tessellation within a bounding box.
这个函数生成一个六边形镶嵌在包围盒。


用法----------Usage----------


hexGrid(nodes.per.layer, b.box, ...)



参数----------Arguments----------

参数:nodes.per.layer
the number of hexagons from min.x to max.x at min.y.  
六边形的数量从min.xmax.xmin.y。


参数:b.box
the domain's bounding box defined with a vector of length four and elements ordered min.x, min.y, max.x, max.y.  
域的定义与向量长度为4和元素的边界框下令min.x,min.y,max.x,max.y。


参数:...
currently no additional arguments.  
目前没有任何额外的参数。


值----------Value----------

A list with the following tags:
下面的标签列表:


参数:hx.hy
a vector of length two that holds the height and width, respectively, between hexagon centroids.  
保持的高度和宽度,分别六边形形心之间的向量的长度为二。


参数:layers
the number of hexagon layers within the domain.  
内六角层域的数量。


参数:nodes.per.layer
the number of hexagons from min.x to max.x at min.y.  
六边形的数量从min.xmax.xmin.y。


参数:hex.centroids
an nx2 matrix with rows corresponding the the x and y coordinates of the n hexagons within the domain.  
nx2行相应的矩阵x和y的n六边形内的域名协调。


参数:hex.polygons
a list with 6x2 matrices which hold the hexagons' x and y vertices coordinates.
6x2矩阵持有的六边形x和y顶点坐标的列表。


(作者)----------Author(s)----------


Andrew O. Finley <a href="mailto:finleya@msu.edu">finleya@msu.edu</a>, <br>
Sudipto Banerjee <a href="mailto:baner009@umn.edu">baner009@umn.edu</a>



实例----------Examples----------


## Not run: [#不运行:]

##Define the bounding box and make the call[#定义边框和拨打检测]
b.box <- c(0,0,10,10)

out <- hexGrid(20, b.box)

##Plot using lapply[#图使用lapply]
par(mfrow=c(1,2))
   
plot(out$hex.centroids, pch=19, cex=0.5,
     ylab="Northing", xlab="Easting")
lapply(out$hex.polygons, polygon, col="blue")

##Now color hexagons based on value[#颜色六边形基于价值]
my.col.ramp <- function(z){
  zlim <- range(z)
  zlen <- zlim[2]-zlim[1]+1
  colorlut <- heat.colors(as.integer(zlen))
  col <- colorlut[z-zlim[1]+1]
  col
}

n <- nrow(out$hex.centroids)
col <- my.col.ramp(rnorm(n))

plot(out$hex.centroids, typ="n", ylab="", xlab="Easting")
for(i in 1:n){
  polygon(out$hex.polygons[[i]], col=col[i], border=col[i])
}


## End(Not run)[#(不执行)]

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-6-17 02:47 , Processed in 0.033098 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表