labeling_text(labels = TRUE, varnames = labels, tl_labels = NULL,
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 = NULL, offset = c(0, 0, 0, 0),
labbl_varnames = NULL, labels_varnames = FALSE, sep = ": ",
abbreviate = FALSE, rep = TRUE, clip = FALSE, ...)
labeling_conditional(...)
labeling_left(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"), ...)
"gpar"
used for
drawing the labels."gpar"
used for
drawing the variable names."left"
,
"center"
, "right"
) for each of the variables."left"
, "center"
, "right"
) for each of the
four sides of the plot."left"
, "center"
, "right"
) for each of the
variables."left"
, "center"
, "right"
) for each of the
four sides of the plot."labels_varnames"
is TRUE
.TRUE
means 1 character, FALSE
causes no abbreviation.
Values are recycled as needed."top"
or
"bottom"
position of the labels (only used for
labeling_doubledecker
).labeling_conditional
: parameters
passed to labeling_cells
and labeling_text
."dimnames"
attribute from the visualized contingency
table, or the visualized table itself from which the
"dimnames"
attributes will then be extracted.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 This help page only documents labeling_text
and
derived functions, more functions are described on the help page
for labeling_cells
and labeling_list
.
labeling_left
, labeling_cboxed
, and labeling_lboxed
are really just wrappers to labeling_text
, and good examples for
the parameter usage.
labeling_cells
,
labeling_list
,
structable
,
grid.text
mosaic(Titanic)
mosaic(Titanic, labeling = labeling_left)
labeling_left
mosaic(Titanic, labeling = labeling_cboxed)
labeling_cboxed
mosaic(Titanic, labeling = labeling_lboxed)
labeling_lboxed
data(PreSex)
mosaic(~ PremaritalSex + ExtramaritalSex | Gender + MaritalStatus,
data = PreSex,
labeling = labeling_conditional)
## specification of vectorized arguments
mosaic(Titanic,
labeling_args = list(abbreviate = c(Survived = TRUE)))
mosaic(Titanic,
labeling_args = list(clip = TRUE, boxes = TRUE,
fill_boxes = c(Survived = "blue","red"))
)
Run the code above in your browser using DataLab