labeling_border(vcd)
labeling_border()所属R语言包:vcd
Labeling Functions for Strucplots
标签功能为Strucplots的
译者:生物统计家园网 机器人LoveR
描述----------Description----------
These functions generate labeling functions used for strucplots.
这些功能产生标签功能用于strucplots。
用法----------Usage----------
labeling_border(labels = TRUE, varnames = labels,
set_labels = NULL, set_varnames = NULL,
tl_labels = NULL, alternate_labels = FALSE, tl_varnames = NULL,
gp_labels = gpar(fontsize = 12),
gp_varnames = gpar(fontsize = 12, fontface = 2),
rot_labels = c(0, 90, 0, 90), rot_varnames = c(0, 90, 0, 90),
pos_labels = "center", pos_varnames = "center",
just_labels = "center", just_varnames = pos_varnames,
boxes = FALSE, fill_boxes = FALSE,
offset_labels = c(0, 0, 0, 0), offset_varnames = offset_labels,
labbl_varnames = NULL, labels_varnames = FALSE, sep = ": ",
abbreviate_labs = FALSE, rep = TRUE, clip = FALSE, ...)
labeling_values(value_type = c("observed", "expected", "residuals"),
suppress = NULL, digits = 1, clip_cells = FALSE, ...)
labeling_residuals(suppress = NULL, digits = 1, clip_cells = FALSE, ...)
labeling_conditional(...)
labeling_left(rep = FALSE, pos_varnames = "left",
pos_labels = "left", just_labels = "left", ...)
labeling_left2(tl_labels = TRUE, clip = TRUE, pos_varnames = "left",
pos_labels = "left", just_labels = "left", ...)
labeling_cboxed(tl_labels = TRUE, boxes = TRUE, clip = TRUE,
pos_labels = "center", ...)
labeling_lboxed(tl_labels = FALSE, boxes = TRUE, clip = TRUE,
pos_labels = "left", just_labels = "left",
labbl_varnames = FALSE, ...)
labeling_doubledecker(lab_pos = c("bottom", "top"), dep_varname = TRUE,
boxes = NULL, clip = NULL, labbl_varnames = FALSE,
rot_labels = rep.int(0, 4),
pos_labels = c("left", "center", "left", "center"),
just_labels = c("left", "left", "left", "center"),
varnames = NULL, gp_varnames = gpar(fontsize = 12, fontface = 2),
offset_varnames = c(0, -0.6, 0, 0), tl_labels = NULL, ...)
参数----------Arguments----------
参数:labels
vector of logicals indicating whether labels should be drawn for a particular dimension.
向量,逻辑值,指示是否标签应制定一个特定的维度。
参数:varnames
vector of logicals indicating whether variable names should be drawn for a particular dimension.
向量,逻辑值,变量名是否应制定一个特定的维度。
参数:set_labels
An optional character vector with named components replacing the so-specified variable names. The component names must exactly match the variable names to be replaced.
一个可选的字符向量更换指定的变量名命名的组件。组件名称必须完全匹配被替换的变量名。
参数:set_varnames
An optional list with named components of character vectors replacing the labels of the so-specified variables. The component names must exactly match the variable names whose labels should be replaced.
可选列表的命名组件的特征向量更换指定的变量的标签。组件名称必须完全匹配的变量名,其标签应予以更换。
参数:tl_labels
vector of logicals indicating whether labels should be positioned on top (column labels) / left (row labels) for a particular dimension.
向量,逻辑值,指示是否应该被放置在顶部的标签(列标签)/左(行标签)为特定的尺寸。
参数:alternate_labels
vector of logicals indicating whether labels should be alternated on the top/bottom (left/right) side of the plot for a particular dimension.
向量,逻辑值,指示是否应轮流在顶部/底部(左/右)侧的图特定维度标签。
参数:tl_varnames
vector of logicals indicating whether variable names should be positioned on top (column labels) / on left (row labels) for a particular dimension.
向量,逻辑值,指示变量名是否应该被放置在顶部(列标签)/左(行标签)为特定的维度。
参数:gp_labels
list of objects of class "gpar" used for drawing the labels.
列表类的对象"gpar"用于绘制的标签。
参数:gp_varnames
list of objects of class "gpar" used for drawing the variable names.
列表类的对象"gpar"用于绘制的变量名。
参数:rot_labels
vector of rotation angles for the labels for each of the four sides of the plot.
的图的四个侧面的每个标签的旋转角度的矢量。
参数:rot_varnames
vector of rotation angles for the variable names for each of the four sides of the plot.
矢量的旋转角度的图的四个侧面的每个变量名。
参数:pos_labels
character string of label positions ("left", "center", "right") for each of the variables.
标签位置的字符串("left","center","right")的每一个变量。
参数:pos_varnames
character string of variable names positions ("left", "center", "right") for each of the four sides of the plot.
字符串变量名的位置("left","center","right")的四边的图。
参数:just_labels
character string of label justifications ("left", "center", "right") for each of the variables.
字符串标签的理由("left","center","right")的每一个变量。
参数:just_varnames
character string of variable names justifications ("left", "center", "right") for each of the four sides of the plot.
字符串变量名的理由("left","center","right")的四边的图。
参数:boxes
vector of logicals indicating whether boxes should be drawn around the labels for a particular dimension.
向量,逻辑值,指示是否箱应制定围绕一个特定的尺寸的标签。
参数:fill_boxes
Either a vector of logicals, or a vector of characters, or a list of such vectors, specifying the fill colors for the boxes. "TRUE" and "FALSE" values are transformed into "grey" and "white", respectively. If fill_boxes is atomic, each component specifies a basic color for the corresponding dimension. This color is transformed into its HSV representation, and the value is varied from 50% to 100% to give a sequential color palette for the levels. For NA components, no palette is produced (no fill color). If fill_boxes is a list of vectors, each vector specifies the level colors of the corresponding dimension.
逻辑值,要么是矢量或矢量的字符,或这样的向量的列表,指定的框的填充颜色。 "TRUE"和"FALSE"值转化为"grey"和"white",分别。如果fill_boxes是原子,每一个组件指定了一个基本的颜色为相应的尺寸。此颜色被转换成其HSV表示,并且该值是从50%至100%之间变化,得到连续彩色调色板的水平。 NA成分,没有调色板(无填充颜色)。如果fill_boxes是一个向量的列表,每个矢量指定相应的维的水平的颜色。
参数:offset_labels, offset_varnames
numeric vector of length 4 indicating the offset of the labels (variable names) for each of the four sides of the plot.
指示的偏移量的标签(变量名)的图的四个侧面的每个的长度为4的数值向量。
参数:labbl_varnames
vector of logicals indicating whether variable names should be drawn on the left (column variables) / on top (row variables) of the corresponding labels.
向量的逻辑值指示变量名是否应绘制在左边(列变量)/(行变量)的相应的标签之上。
参数:labels_varnames
vector of logicals indicating, for each dimension, whether the variable name should be added to the corresponding labels or not.
向量的逻辑值表示,对于每个维度,是否应该被添加到相应的标签或不变量名。
参数:sep
separator used if any component of "labels_varnames" is TRUE.
使用的分隔符如果任何组件的"labels_varnames"是TRUE。
参数:abbreviate_labs
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不会造成缩写。价值被回收作为需要。
参数:rep
vector of logicals indicating, for each dimension, whether labels should be repeated for all conditioning strata, or appear only once.
向量,逻辑值表示,每个维度,标签是否应该被重复所有空调阶层,或只出现一次。
参数:clip
vector of integers indicating, for each dimension, whether labels should be clipped to not overlap.
矢量的指示,对于每个维度,无论标签应被剪切成不重叠的整数。
参数:lab_pos
character string switching between "top" or "bottom" position of the labels (only used for labeling_doubledecker).
字符串转换在"top"或"bottom"位置的标签(只用于labeling_doubledecker之间,)。
参数:dep_varname
logical or character string. If logical, this is indicating whether the name of the dependent variable should be printed or not. A character string will be printed instead of the variable name taken from the dimnames.
逻辑或字符串。如果逻辑,这是指示是否应打印或不因变量的名称。将打印一个字符串的变量名,而不是从dimnames。
参数:value_type
character string specifying which values should be displayed in the cells.
字符的字符串指定的值应被显示在单元。
参数:suppress
numeric vector of length 2 specifying an interval of values that are not displayed. 0 values are never displayed. A single number, <VAR>k</VAR>, is treated as c(-<VAR>k</VAR>, <VAR>k</VAR>). The default for labeling residuals is c(-2,2). Use suppress = 0 to show all non-zero values.
数字矢量长度为2的指定时间间隔的值是不显示的。从不显示0值。单数,<VAR> K表</ VAR>,被视为c(-<VAR>k</VAR>, <VAR>k</VAR>)。标签残差的默认值是c(-2,2)。使用suppress = 0显示所有非零值。
参数:digits
integer specifying the number of digits used for rounding.
整数,指定用于四舍五入的位数。
参数:clip_cells
logical indicating whether the values should be clipped at the cell borders.
逻辑的值是否应该被夹在单元格边框。
参数:...
only used for labeling_conditional and labeling_doubledecker: parameters passed to labeling_cells and labeling_border.
labeling_conditional和labeling_doubledecker:仅用于参数传递给labeling_cells和labeling_border。
Details
详细信息----------Details----------
These functions generate labeling functions called by strucplot for their side-effect of adding labels to the plot. They suppose that a strucplot has been drawn and the corresponding viewport structure is pushed, since the positions of the viewports are used for the label positioning. Note that the functions can also be used "stand-alone" as shown in the examples.
这些功能产生标签称为strucplot副作用的图添加标签的功能。他们假设,一个strucplot已经绘制相应的视口结构被按压时,因为视口的位置被用于标签定位。请注意该功能也可以被使用的“独立”的实施例中所示。
All values supplied to vectorized arguments can be "abbreviated" by using named components which override the default component values. In addition, these defaults can be overloaded by the sequence of non-named components which are recycled as needed (see examples).
提供量化的参数的值可以是“缩写为”使用命名的组件覆盖默认的组件值。此外,这些默认值可以被重载的序列未命名的组件,根据需要回收(参见示例)。
This help page only documents labeling_border and derived functions, more functions are described on the help page for labeling_cells and labeling_list.
此帮助页只记录labeling_border和派生功能,更多的功能帮助页面上的描述为labeling_cells和labeling_list。
labeling_left, labeling_left2, labeling_cboxed, and labeling_lboxed are really just wrappers to labeling_border, and good examples for the parameter usage.
labeling_left,labeling_left2,labeling_cboxed和labeling_lboxed真的只是包装labeling_border,和很好的例子,使用的参数。
labeling_residuals is a trivial wrapper for labeling_values, which in turn calls labeling_border by additionally adding the observed or expected frequencies or residuals to the cells.
labeling_residuals是一个简单的包装为labeling_values,这反过来又要求labeling_border添加所观察到的或预期的频率或残留的单元。
值----------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_cells, labeling_list, structable, grid.text
labeling_cells,labeling_list,structable,grid.text
实例----------Examples----------
data("Titanic")
mosaic(Titanic)
mosaic(Titanic, labeling = labeling_left)
labeling_left
mosaic(Titanic, labeling = labeling_cboxed)
labeling_cboxed
mosaic(Titanic, labeling = labeling_lboxed)
labeling_lboxed
data("reSex")
mosaic(~ PremaritalSex + ExtramaritalSex | Gender + MaritalStatus,
data = PreSex, labeling = labeling_conditional)
## specification of vectorized arguments [#量化的参数规格]
mosaic(Titanic, labeling_args = list(abbreviate_labs = c(Survived = TRUE)))
mosaic(Titanic, labeling_args = list(clip = TRUE, boxes = TRUE,
fill_boxes = c(Survived = "green", "red")))
mosaic(Titanic, labeling_args = list(clip = TRUE, boxes = TRUE,
fill_boxes = list(Sex = "red", "green")))
mosaic(Titanic, labeling_args = list(clip = TRUE, boxes = TRUE,
fill_boxes = list(Sex = c(Male = "red", "blue"), "green")))
## change variable names[#更改变量名。]
mosaic(Titanic, labeling_args = list(set_varnames = c(Sex = "Gender")))
## change labels[#更改标签]
mosaic(Titanic, labeling_args = list(set_varnames = c(Survived = "Status"),
set_labels = list(Survived = c("Survived", "Not Survived")), rep = FALSE))
## show frequencies[#显示频率]
mosaic(Titanic, labeling = labeling_values)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|