labeling_cells_list(vcd)
labeling_cells_list()所属R语言包:vcd
Labeling Functions for Strucplots
标签功能为Strucplots的
译者:生物统计家园网 机器人LoveR
描述----------Description----------
These functions generate labeling functions that produce labels for strucplots.
这些功能产生的标注功能的产生标签strucplots的。
用法----------Usage----------
labeling_cells(labels = TRUE, varnames = TRUE,
abbreviate_labels = FALSE, abbreviate_varnames = FALSE,
gp_text = gpar(), lsep = ": ", lcollapse = "\n",
just = "center", pos = "center", rot = 0,
margin = unit(0.5, "lines"), clip_cells = TRUE,
text = NULL, ...)
labeling_list(gp_text = gpar(), just = "left", pos = "left", lsep = ": ",
sep = " ", offset = unit(c(2, 2), "lines"),
varnames = TRUE, cols = 2, ...)
参数----------Arguments----------
参数:labels
vector of logicals indicating, for each dimension, whether labels for the factor levels should be drawn or not. Values are recycled as needed.
向量的逻辑值表示,对于每个维度,因子水平的标签是否应绘制或没有。价值被回收作为需要。
参数:varnames
vector of logicals indicating, for each dimension, whether variable names should be drawn. Values are recycled as needed.
向量,逻辑值表示,每个维度的变量名,是否应制定。价值被回收作为需要。
参数:abbreviate_labels
vector of integers or logicals indicating, for each dimension, the number of characters the labels should be abbreviated to. TRUE means 1 character, FALSE causes no abbreviation. Values are recycled as needed.
整数或逻辑值表示的向量,为每个维度的数目的字符的标签应被缩写为。 TRUE是指1个字符,FALSE不会造成缩写。价值被回收作为需要。
参数:abbreviate_varnames
vector of integers or logicals indicating, for each dimension, the number of characters the variable (i.e., dimension) names should be abbreviated to. TRUE means 1 character, FALSE causes no abbreviation. Values are recycled as needed.
的整数或逻辑值,表明向量,为每个维度,应该是字符变量的数量(即,尺寸)的名称缩写为。 TRUE是指1个字符,FALSE不会造成缩写。价值被回收作为需要。
参数:gp_text
object of class "gpar" used for the text drawn.
类的对象"gpar"用于绘制文本。
参数:lsep
character that separates variable names from the factor levels.
字符,分离因子水平的变量名。
参数:sep
character that separates the factor levels (only used for labeling_list).
字符分隔的因子水平(仅用于labeling_list)。
参数:offset
object of class "unit" of length 2 specifying the offset in x- and y-direction of the text block drawn under the strucplot (only used for labeling_list).
类的对象"unit"长度为2的指定的偏移量在x-和y-方向的绘制下的strucplot(仅用于labeling_list)的文本块。
参数:cols
number of text columns (only used for labeling_list).
文字的列数(仅用于为labeling_list)。
参数:lcollapse
character that separates several variable name/factor level-combinations. Typically a line break. (Only used for labeling_cells.)
字符分隔多个变量名/因子水平组合。通常情况下,换行符。 (仅用于labeling_cells)。
参数:just, pos
character string of length 1 (labeling_list) or at most 2 (labeling_cells) specifying the labels' horizontal position and justification (horizontal and vertical for labeling_cells).
字符串长度1(labeling_list)或最多2个(labeling_cells)指定标签的水平位置和理由(水平和垂直labeling_cells)。
参数:rot
rotation angle in degrees, used for all labels (only used for labeling_cells).
旋转的角度,所有的标签(仅用于labeling_cells)。
参数:margin
object of class "unit" (a numeric value is converted to "lines") specifying an offset from the cell borders (only used for labeling_cells).
类的对象"unit"(一个数值转换为"lines")指定的单元格边框(仅用于labeling_cells)抵销。
参数:clip_cells
logical indicating whether text should be clipped at the cell borders (only used for labeling_cells).
逻辑说明文本是否应在单元格边框裁剪(仅用于labeling_cells)。
参数:text
Optionally, a character table of the same dimensions than the contingency table whose entries will then be used instead of the labels. NA entries are not drawn. This allows custom cell annotations (see examples). Only used for labeling_cells.
任选地,然后将其条目的列联表的相同的尺寸比一个字符表代替标签。 NA条目就不画了。这使得自定义单元格的批注(见例子)。仅用于labeling_cells。
参数:...
Currently not used.
目前没有使用。
Details
详细信息----------Details----------
These functions generate labeling functions that can add different kinds of labels to an existing plot. Typically they are supplied to strucplot which then generates and calls the labeling function. They assume that a strucplot has been drawn and the corresponding viewport structure is pushed, so that by navigating through the viewport tree the labels can be positioned appropriately.
这些功能产生的标签功能,可以添加不同种类的标签,以现有的图。通常情况下,他们提供给然后生成和调用的标签功能strucplot。他们认为一个strucplot已制定相应的视口结构推,因此,通过视树的标签导航可以适当位置。
This help page only documents labeling_list and labeling_cells; more functions are described on the help page for labeling_border.
此帮助页只记录labeling_list和labeling_cells;更多的功能帮助页面上的labeling_border。
The functions can also be used "stand-alone" as shown in the examples.
的功能,也可以使用的“独立”的实施例中所示。
Using labeling_list will typically necessitate a bottom margin adjustment.
使用labeling_list通常会须下边距调整。
值----------Value----------
A function with arguments:
的功能与参数:
参数:d
"dimnames" attribute from the visualized contingency table, or the visualized table itself from which the "dimnames" attributes will then be extracted.
"dimnames"属性的可视化的应变表中,或从中"dimnames"属性然后将被提取的可视化表本身。
参数:split_vertical
vector of logicals indicating the split directions.
分割向量,逻辑值,指明方向。
参数:condvars
integer vector of conditioning dimensions
调节尺寸的整数向量
(作者)----------Author(s)----------
David Meyer <a href="mailtoavid.Meyer@R-project.org">David.Meyer@R-project.org</a>
参考文献----------References----------
The strucplot framework: Visualizing multi-way contingency tables with <code>vcd</code>. Journal of Statistical Software, 17(3), 1-48. URL http://www.jstatsoft.org/v17/i03/ and available as <code>vignette("strucplot")</code>.
参见----------See Also----------
labeling_border, structable, grid.text
labeling_border,structable,grid.text
实例----------Examples----------
data("Titanic")
mosaic(Titanic, labeling = labeling_cells)
mosaic(Titanic, labeling = labeling_list)
## A more complex example, adding the observed frequencies[#更复杂的例子,观测频率]
## to a mosaic plot:[#的马赛克图:]
tab <- ifelse(Titanic < 6, NA, Titanic)
mosaic(Titanic, pop = FALSE)
labeling_cells(text = tab, margin = 0)(Titanic)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|