plot.stslist(TraMineR)
plot.stslist()所属R语言包:TraMineR
Plot method for state sequence objects
状态序列对象的绘制方法
译者:生物统计家园网 机器人LoveR
描述----------Description----------
This is the plot method for state sequence objects of class stslist created by the seqdef function. It produces a sequence index plot.
这是stslist创建seqdef功能的类的对象的状态序列图法。它产生的序列索引图。
用法----------Usage----------
## S3 method for class 'stslist'
plot(x, tlim=NULL, weighted=TRUE, sortv=NULL,
cpal=NULL, missing.color=NULL,
ylab, yaxis = TRUE, xaxis = TRUE, ytlab = NULL, ylas=0,
xtlab = NULL, xtstep = NULL, cex.plot=1, ...)
参数----------Arguments----------
参数:x
A state sequence object created with the seqdef function.
与seqdef函数创建的对象的状态序列。
参数:tlim
Indexes of the sequences to be plotted (default value is 1:10), for instance 20:50 to plot sequences 20 to 50, c(2,8,12,25) to plot sequences 2,8,12 and 25 in seqdata. If set to 0, all sequences in seqdata are plotted.
要绘制的序列索引(默认值是1:10),例如20:50绘制序列20至50,c(2,8,12,25)绘制序列2,8,12和25seqdata。中的所有序列如果设置为0,seqdata绘制。
参数:weighted
Logical: Should the bar representing each sequence be proportional to its weight? Ignored when no weights are assigned to sequences (see seqdef.)
逻辑:如果每个序列的条形是它的重量成正比吗?没有重量被分配到序列时忽略(见seqdef。)
参数:sortv
A sorting variable or a sort method (one of "from.start" or "from.end"). See details.
一个分类变量或一种方法(1"from.start"或"from.end")。查看详细信息。
参数:cpal
alternative color palette to use for the states. If user specified, a vector of colors with number of elements equal to the number of states in the alphabet. By default, the cpal attribute of the seqdata sequence object is used (see seqdef).
替代调色板使用的状态。如果用户指定的颜色与数量相等的元素的数量在字母表中的一个向量。默认情况下,cpal seqdata序列对象的属性(见seqdef“)。
参数:missing.color
alternative color for representing missing values inside the sequences. By default, this color is taken from the "missing.color" attribute of the x sequence object.
另一种颜色代表缺失值序列内。默认情况下,这个颜色是取自x序列对象的“missing.color”属性。
参数:ylab
An optional label for the y axis. If set to NA, no label is drawn.
一个可选的标签为Y轴。如果设置为NA,没有标签的绘制。
参数:yaxis
Controls whether the y axis is plotted or not. When set to TRUE, sequence indexes are displayed.
控制是否绘制或不y轴。当设置为TRUE,序列索引。
参数:xaxis
if TRUE (default), the x (time) axis is plotted.
如果TRUE(默认),X(时间)轴绘制。
参数:ytlab
the labels of the plotted sequences to display on the y axis. Default is the indexes of the sequences as defined by the tlim argument. Can be set to "id" for displaying the row names (id) of the sequences instead of their indexes; row names can be assigned to the sequence object with the id argument of the seqdef function or afterwards with rownames. Otherwise ytlab can be set to a vector of length equal to the number of sequences to be plotted.
绘制的序列的标签,以显示在y轴上。默认值是tlim参数定义的索引序列。可以设置为"id"显示的行名(ID)的序列,而不是他们的索引;行名称id seqdef函数的参数可以分配到的序列对象后与rownames。否则ytlab可以被设置到一个向量的长度等于要绘制的序列的数目。
参数:ylas
sets the orientation of the sequence labels appearing on the y axis. Accepted values are the same as for the las standard option <br> 0: always parallel to the axis (default), <br> 1: always horizontal, <br> 2: always perpendicular to the axis, <br> 3: always vertical.
设置序列标签出现在y轴的取向。可接受的值是相同为las标准选项<br> 0:总是平行于轴线(默认值),参考1:总水平,<BR>的2:总是垂直于轴线, 3:总是垂直的。
参数:xtlab
optional labels for the x axis ticks labels. If unspecified, the column names of the seqdata sequence object are used (see seqdef).
x轴刻度线标签可选标签。如果未指定,seqdata序列对象的列名(见seqdef“)。
参数:xtstep
optional interval at which the tick-marks and labels of the x-axis are displayed. For example, with xtstep=3 a tick-mark is drawn at position 1, 4, 7, etc... The display of the corresponding labels depends on the available space and is dealt with automatically. If unspecified, the xtstep attribute of the x object is used.
可选的时间间隔被显示的x-轴的刻度标记和标签。例如,xtstep=3一个刻度线被画在位置1,4,7,等..的相应的标签的显示取决于可用的空间和自动处理。如果未指定,xtstep属性x对象。
参数:cex.plot
expansion factor for setting the size of the font for the axis labels and names of the axes. The default value is 1. Values lesser than 1 will reduce the size of the font, values greater than 1 will increase it.
设置轴标签的字体和轴的名称的大小扩展系数。默认值是1。跌幅小于1的值会减少字体的大小,大于1的值将增加。
参数:...
arguments to be passed to the plot function or other graphical parameters.
参数被传递到绘图功能或其他图形参数。
Details
详细信息----------Details----------
This is the default plot method for state sequence objects (produced by the seqdef function), i.e., for objects of class stslist. It produces a sequence index plot, where individual sequences are rendered with stacked bars depicting the states over time. <br> <br>
这是默认的图的状态序列对象(seqdef功能)的方法,即对对象的类stslist。它产生的序列索引图,堆积条形图描绘了随着时间的推移,其中个别的序列呈现。参考参考
This method is called by the generic seqplot function (if type="i"). The latter produces more sophisticated plots, allowing grouping and automatic display of the state color legend. The seqiplot function is a shortcut for calling seqplot with type="i".
调用此方法的通用seqplot函数(如果type="i")。后者产生更复杂的图,允许分组和自动显示的状态传奇的色彩。 seqiplot函数调用seqplottype="i"的快捷方式。
When a sortv variable is provided to seqiplot or seqIplot, its values define the order in which the sequences are plotted. With sortv = "from.start", sequence are sorted by the elements of the alphabet at the successive positions starting from the beginning of the sequences. The "from.end" method proceeds similarly, but backward from the last position.
当一个sortv变量设置到seqiplot或seqIplot,其值定义绘制的序列的顺序进行。随着sortv = "from.start",序列中的字母的元素排序条件为在从序列的开头开始的连续位置。 “from.end”的方法类似,但落后从最后位置进行。
The interest of sequence index plots has for instance been stressed by <CITE>Scherer (2001)</CITE> and <CITE>Brzinsky-Fay et al. (2006)</CITE>. Notice that such index plots for thousands of sequences result in very heavy graphic files if they are stored in PDF or POSTSCRIPT format. To reduce the size, we suggest saving the figures in bitmap format by using for instance png instead of postscript or pdf.
的利息的序列索引图,例如<CITE>谢勒(2001)</ CITE> <CITE> Brzinsky费伊等人所强调的。 (2006年)</ CITE>。请注意,成千上万的序列,结果在非常沉重图形文件,如果这样的索引图,它们存储在PDF或PostScript格式。为了减少大小,我们建议保存位图格式的数字通过使用例如png,而不是postscript或pdf。
参见----------See Also----------
seqplot
seqplot
实例----------Examples----------
## Defining a sequence object with the data in columns 10 to 25[#定义一个序列对象中的数据列10至25]
## (family status from age 15 to 30) in the biofam data set[#(家庭状况从15岁至30日)在biofam数据集]
data(biofam)
biofam.lab <- c("Parent", "Left", "Married", "Left+Marr",
"Child", "Left+Child", "Left+Marr+Child", "Divorced")
biofam.seq <- seqdef(biofam, 10:25, labels=biofam.lab)
## Plot of the 10 most frequent sequences[10个最常见的序列号地]
## with bar width proportional to the frequency[#带条形的宽度成正比的频率]
plot(biofam.seq)
## Plotting the all data set[#绘制的所有数据集]
## with no borders[#无边框]
plot(biofam.seq, tlim=0, space=0, border=NA)
## =======[#=======]
## Weights[#重量]
## =======[#=======]
data(ex1)
ex1.seq <- seqdef(ex1, 1:13, weights=ex1$weights)
plot(ex1.seq)
plot(ex1.seq, weighted=FALSE)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|