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

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

[复制链接]
发表于 2012-9-30 10:53:04 | 显示全部楼层 |阅读模式
gplot(sna)
gplot()所属R语言包:sna

                                         Two-Dimensional Visualization of Graphs
                                         二维可视化图

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

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

gplot produces a two-dimensional plot of graph g in collection dat.  A variety of options are available to control vertex placement, display details, color, etc.
gplot产生一个二维图的图形g收集dat。可控制顶点的位置,显示细节,颜色等多种选择


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


gplot(dat, g = 1, gmode = "digraph", diag = FALSE,
    label = NULL, coord = NULL, jitter = TRUE, thresh = 0,
    usearrows = TRUE, mode = "fruchtermanreingold",
    displayisolates = TRUE, interactive = FALSE, interact.bycomp = FALSE,
    xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, pad = 0.2,
    label.pad = 0.5, displaylabels = !is.null(label), boxed.labels = FALSE,
    label.pos = 0, label.bg = "white", vertex.sides = NULL, vertex.rot = 0,
    arrowhead.cex = 1, label.cex = 1, loop.cex = 1, vertex.cex = 1,
    edge.col = 1, label.col = 1, vertex.col = NULL, label.border = 1,
    vertex.border = 1, edge.lty = 1, label.lty = NULL, vertex.lty = 1,
    edge.lwd = 0, label.lwd = par("lwd"), edge.len = 0.5,
    edge.curve = 0.1, edge.steps = 50, loop.steps = 20,
    object.scale = 0.01, uselen = FALSE, usecurve = FALSE,
    suppress.axes = TRUE, vertices.last = TRUE, new = TRUE,
    layout.par = NULL, ...)



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

参数:dat
a graph or set thereof.  This data may be valued.
其图形或一组。这个数据可能受到重视。


参数:g
integer indicating the index of the graph which is to be plotted.  By default, g==1.
整数,表示要绘制的曲线图,它的索引。默认情况下,g==1。


参数:gmode
String indicating the type of graph being evaluated.  "digraph" indicates that edges should be interpreted as directed; "graph" indicates that edges are undirected; "twomode" indicates that data should be interpreted as two-mode (i.e., rows and columns are distinct vertex sets).  gmode is set to "digraph" by default.
的图表类型的字符串,表示正在评估中。 "digraph"表明边缘应被解释为指示;"graph"表明边缘是无向;"twomode"表示双模式(即,行和列的数据应该被解释为不同的顶点集)。 gmode默认情况下被设置成"digraph"。


参数:diag
boolean indicating whether or not the diagonal should be treated as valid data.  Set this true if and only if the data can contain loops.  diag is FALSE by default.
布尔值,表示是否对角线应被视为有效的数据。设置这是真的,当且仅当数据可以包含循环。 diag是FALSE默认情况下。


参数:label
a vector of vertex labels, if desired; defaults to the vertex index number.
一个向量的顶点标签,如果需要的话,默认为顶点的索引号。


参数:coord
user-specified vertex coordinates, in an NCOL(dat)x2 matrix.  Where this is specified, it will override the mode setting.
用户指定的顶点坐标,在NCOL(dat)与×2矩阵。这是指定的,,它将覆盖mode。


参数:jitter
boolean; should the output be jittered?
布尔,输出抖动?


参数:thresh
real number indicating the lower threshold for tie values.  Only ties of value >thresh are displayed.  By default, thresh=0.
实数,表示领带值的下限阈值。只有价值的关系> thresh被显示出来。默认情况下,thresh= 0。


参数:usearrows
boolean; should arrows (rather than line segments) be used to indicate edges?
布尔;应箭头(而非线段)被用来指示边缘?


参数:mode
the vertex placement algorithm; this must correspond to a gplot.layout function.
顶点的布局算法,这必须对应于一个gplot.layout功能。


参数:displayisolates
boolean; should isolates be displayed?
布尔值;菌株显示?


参数:interactive
boolean; should interactive adjustment of vertex placement be attempted?
布尔,互动调整的顶点位置可以尝试吗?


参数:interact.bycomp
boolean; if interactive==TRUE, should all vertices in the component be moved?
布尔interactive==TRUE如果,应该在组件中的所有顶点移动吗?


参数:xlab
x axis label.
x轴的标签。


参数:ylab
y axis label.
y轴的标签。


参数:xlim
the x limits (min, max) of the plot.
在x限制(最小值,最大值)的图。


参数:ylim
the y limits of the plot.  
在y限制的图。


参数:pad
amount to pad the plotting range; useful if labels are being clipped.
量垫的作图范围,有用的,如果标签被修剪。


参数:label.pad
amount to pad label boxes (if boxed.labels==TRUE), in character size units.
金额垫标签框(如果boxed.labels==TRUE),字符大小单位。


参数:displaylabels
boolean; should vertex labels be displayed?
布尔值;顶点的标签显示?


参数:boxed.labels
boolean; place vertex labels within boxes?
布尔方框内放置顶点的标签吗?


参数:label.pos
position at which labels should be placed, relative to vertices.  0 results in labels which are placed away from the center of the plotting region; 1, 2, 3, and 4 result in labels being placed below, to the left of, above, and to the right of vertices (respectively); and label.pos>=5 results in labels which are plotted with no offset (i.e., at the vertex positions).
标签应放置的位置上,相对的顶点。 0结果在标签放置在远离绘图区域的中心,“1,2,3,4在标签下面放置,左侧的,上面,以及右侧的顶点(分别);label.pos>=5的查询结果在这些绘制与没有偏移(即,在顶点的位置)的标签中。


参数:label.bg
background color for label boxes (if boxed.labels==TRUE); may be a vector, if boxes are to be of different colors.
用于标记框的背景颜色(如果boxed.labels==TRUE),可以是一个矢量,如果框是采用不同的颜色。


参数:vertex.sides
number of polygon sides for vertices; may be given as a vector, if vertices are to be of different types.  By default, 8 sides are used (or 8 and 4, for two-mode data).
可以给出一个向量数目多边形顶点双方;顶点是,如果是不同的类型。缺省情况下,使用8侧(或8和图4,为两个模式数据)。


参数:vertex.rot
angle of rotation for vertices (in degrees); may be given as a vector, if vertices are to be rotated differently.
顶点(以度为单位)的旋转角度,可以给出一个向量,如果顶点是不同的方式进行旋转。


参数:arrowhead.cex
expansion factor for edge arrowheads.
边箭头的膨胀系数。


参数:label.cex
character expansion factor for label text.
标签文本的字符膨胀系数。


参数:loop.cex
expansion factor for loops; may be given as a vector, if loops are to be of different sizes.
;循环扩展系数可以给出一个矢量,如果循环是具有不同的尺寸。


参数:vertex.cex
expansion factor for vertices; may be given as a vector, if vertices are to be of different sizes.
;顶点扩展系数可以给出一个矢量,如果顶点是具有不同的尺寸。


参数:edge.col
color for edges; may be given as a vector or adjacency matrix, if edges are to be of different colors.
边缘的颜色;可以给出一个矢量或邻接矩阵,如果边缘是采用不同的颜色。


参数:label.col
color for vertex labels; may be given as a vector, if labels are to be of different colors.
颜色为顶点的标签;可以给出一个矢量,如果标签是采用不同的颜色。


参数:vertex.col
color for vertices; may be given as a vector, if vertices are to be of different colors.  By default, red is used (or red and blue, for two-mode data).
顶点颜色2作为向量,如果顶点是采用不同的颜色,可给予。缺省情况下,使用红色(或红色和蓝色,为两个模式数据)。


参数:label.border
label border colors (if boxed.labels==TRUE); may be given as a vector, if label boxes are to have different colors.
标签边框颜色(如果boxed.labels==TRUE)可能会给出一个向量,,如果标签框有不同的颜色。


参数:vertex.border
border color for vertices; may be given as a vector, if vertex borders are to be of different colors.
边框颜色为顶点;作为向量,可给予,如果顶点边界采用不同的颜色。


参数:edge.lty
line type for edge borders; may be given as a vector or adjacency matrix, if edge borders are to have different line types.
线类型的边缘的边界;可以给出一个矢量或邻接矩阵,如果边缘的边界是具有不同的行类型。


参数:label.lty
line type for label boxes (if boxed.labels==TRUE); may be given as a vector, if label boxes are to have different line types.
用于标记框的线类型(如果boxed.labels==TRUE),可以给出一个矢量,如果标签框是具有不同的行类型。


参数:vertex.lty
line type for vertex borders; may be given as a vector or adjacency matrix, if vertex borders are to have different line types.
线路类型为顶点边界;可以给出一个矢量或邻接矩阵,如果顶点边界是具有不同的行类型。


参数:edge.lwd
line width scale for edges; if set greater than 0, edge widths are scaled by edge.lwd*dat.  May be given as a vector or adjacency matrix, if edges are to have different line widths.
边缘线的宽度比例,,如果设置边缘宽度大于0,缩放edge.lwd*dat。可以给出一个矢量或邻接矩阵,如果边缘是具有不同的线宽度。


参数:label.lwd
line width for label boxes (if boxed.labels==TRUE); may be given as a vector, if label boxes are to have different line widths.
用于标记框的线宽度(如果boxed.labels==TRUE),可以给出一个矢量,如果标签框是具有不同的线宽度。


参数:edge.len
if uselen==TRUE, curved edge lengths are scaled by edge.len.
如果uselen==TRUE,弯曲边长缩放edge.len。


参数:edge.curve
if usecurve==TRUE, the extent of edge curvature is controlled by edge.curv.  May be given as a fixed value, vector, or adjacency matrix, if edges are to have different levels of curvature.  
如果usecurve==TRUE,边缘弯曲的程度是由edge.curv。可以给出一个固定的值,向量,或邻接矩阵,如果边缘有不同程度的曲率。


参数:edge.steps
for curved edges (excluding loops), the number of line segments to use for the curve approximation.
弯曲的边缘(不包括循环),使用曲线逼近的线段数。


参数:loop.steps
for loops, the number of line segments to use for the curve approximation.
for循环,线段的数目,使用的曲线近似。


参数:object.scale
base length for plotting objects, as a fraction of the linear scale of the plotting region. Defaults to 0.01.
为绘制的对象,作为绘图区域的一小部分的线性标尺的碱基长度。默认值为0.01。


参数:uselen
boolean; should we use edge.len to rescale edge lengths?
布尔,我们应该使用edge.len重新调整边长吗?


参数:usecurve
boolean; should we use edge.curve?
布尔,我们使用“edge.curve?


参数:suppress.axes
boolean; suppress plotting of axes?
布尔值;抑制绘制的轴?


参数:vertices.last
boolean; plot vertices after plotting edges?
布尔值;图绘制边缘的顶点后?


参数:new
boolean; create a new plot?  If new==FALSE, vertices and edges will be added to the existing plot.
布尔值;创建一个新的图?如果new==FALSE,顶点和边将被添加到现有的图。


参数:layout.par
parameters to the gplot.layout function specified in mode.
参数到gplot.layout函数指定的mode。


参数:...
additional arguments to plot.
附加参数到plot。


Details

详细信息----------Details----------

gplot is the standard network visualization tool within the sna library.  By means of clever selection of display parameters, a fair amount of display flexibility can be obtained.  Graph layout – if not specified directly using coord – is determined via one of the various available algorithms.  These should be specified via the mode argument; see gplot.layout for a full list.  User-supplied layout functions are also possible – see the aforementioned man page for details.
gplot是标准的网络可视化的工具在sna库中。通过聪明的选择,显示参数,可以得到相当数量的显示灵活性。图形布局 - 如果没有指定,直接使用coord  - 通过现有的各种算法之一。这些应通过mode参数指定gplot.layout的完整列表。用户提供的的布局功能也可能 - 页的详细信息,请参阅上述的人。

Note that where gmode=="twomode", the supplied two-mode network is converted to bipartite form prior to computing coordinates (if not in that form already).  vertex.col or other settings may be used to differentiate row and column vertices – by default, row vertices are drawn as red octagons, and column vertices are rendered as blue squares.  If interactive==TRUE, then the user may modify the initial graph layout by selecting an individual vertex and then clicking on the location to which this vertex is to be moved; this process may be repeated until the layout is satisfactory.  If interact.bycomp==TRUE as well, the vertex and all other vertices in the same component as that vertex are moved together.
请注意,在gmode=="twomode",提供了两个模式的网络转换为偶形式计算坐标(如果不是在这种形式的话)之前。 vertex.col或其他设置可能会被用来区分不同的行和列的顶点 - 默认情况下,行顶点画成红色八角形,柱顶点呈现为蓝色正方形。如果interactive==TRUE,那么用户可以修改的初始图形布局,通过选择一个单独的顶点,然后单击该顶点是要移动的位置上,这一过程可重复进行,直到布局是令人满意的。如果interact.bycomp==TRUE,顶点和所有其他顶点,顶点在同一组件中一起移动。


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

A two-column matrix containing the vertex positions as x,y coordinates.  
两列的矩阵,包含顶点位置为x,y坐标。


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



Carter T. Butts <a href="mailto:buttsc@uci.edu">buttsc@uci.edu</a>


Alex Montgomery <a href="mailto:ahm@reed.edu">ahm@reed.edu</a>




参考文献----------References----------

<h3>See Also</h3>

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


gplot(rgraph(5))               #Plot a random graph[绘制一个随机图]
gplot(rgraph(5),usecurv=TRUE)  #This time, use curved edges[这个时候,使用弧形边缘]
gplot(rgraph(5),mode="mds")    #Try an alternative layout scheme[尝试其他布局方案]

#A colorful demonstration...[丰富多彩的示范...]
gplot(rgraph(5,diag=TRUE),diag=TRUE,vertex.cex=1:5,vertex.sides=3:8,
    vertex.col=1:5,vertex.border=2:6,vertex.rot=(0:4)*72,
    displaylabels=TRUE,label.bg="gray90")
   

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-6-8 01:55 , Processed in 0.026337 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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