element_block {tablesgg} | R Documentation |
Specify Visual Properties for Table Blocks
Description
Specify a set of graphical properties that can be used to highlight a rectangular block of table cells.
Usage
element_block(fill=NULL, fill_alpha=NULL, border_size=NULL,
border_colour=NULL, border_color=NULL, enabled=NULL,
inherit.blank=FALSE)
Arguments
fill , fill_alpha , border_size , border_color |
Scalar graphical properties for the table blocks. These will be passed to
|
border_colour |
Alias for |
enabled |
Logical scalar, controlling whether the block is displayed (TRUE) or not (FALSE). |
inherit.blank |
Ignored. |
Details
This function is modeled on the element_*
functions used in
ggplot2
to specify graphical properties in themes. It is primarily
used to create the value on the right-hand side of an assignment involving
the props<-
group of setter functions.
To display a table block means to highlight its rectangular region with
shading (as specified by fill
, a color, and fill_alpha
)
and/or a border (with thickness specified by border_size
, in mm,
and color border_color
). Blocks are drawn before entries and
hvrules, so the latter are drawn "on top" of blocks and will not be
hidden.
Quantitative property border_size
may be specified using the
ggplot2
function rel()
. This function indicates that the
value is to be interpreted as a multiplier to be applied to whatever the
current value of the property is. For example border_size=rel(1.2)
specifies that the thickness of the border around a block is to be
increased by 20% from its current value.
Value
An object of S3 classes element_block
and element
.
See Also
element_entry
, element_hvrule
;
elements
for more detail about the available graphical
properties; props<-
, propsa<-
,
propsd<-
.
Examples
plt <- plot(iris2_tab, title="Summary statistics for the iris data")
props(plt, id="rowhead") <- element_block(fill="lightblue")
props(plt, id="colblock/C/2/1") <- element_block(border_color="red")
# (Default fill color for blocks is 'gray85')
plt