View source: R/elements.bare.R
element_hvrule | R Documentation |
Specify a set of graphical properties that can be used to display horizontal or vertical rules (hvrules) in a table.
element_hvrule(colour=NULL, alpha=NULL, linetype=NULL, size=NULL,
fill=NULL, fill_alpha=NULL, space=NULL, color=NULL, enabled=NULL,
inherit.blank=FALSE)
color , alpha , linetype , size |
Scalar values for the graphical properties that are used to display the
horizontal or vertical line of an hvrule. Values will be passed to
|
fill , fill_alpha , space |
Scalar values for the graphical properties of the (long, thin) rectangle
that encloses an hvrule. |
colour |
Alias for |
enabled |
Logical scalar, controlling whether the hvrule is displayed (TRUE) or not (FALSE). This applies to both the actual rule (line) and the rectangle containing it. |
inherit.blank |
Ignored. |
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.
A horizontal or vertical rule (hvrule) is actually drawn as long, narrow
rectangle, with a line centered inside it. The narrowness of the
rectangle, and thus how much space the hvrule adds to the table, is
controlled by space
. The thickness of the line inside the
rectangle is controlled by size
. Setting linetype
to 0
means no line will be drawn, but the enclosing rectangle will be. In that
way hvrules can be used to insert extra blank space between rows or
columns of a table.
Quantitative properties size
and space
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
space=rel(1.2)
specifies that the space
property of an entry
is to be increased by 20% from its current value.
An object of S3 classes element_hvrule
and element
.
element_entry
, element_block
;
elements
for more detail about the available graphical
properties; props<-
, propsa<-
,
propsd<-
.
plt <- plot(iris2_tab, title="Summary statistics for the iris data")
plt
# Enable the vertical rule between rowhead and body, and set its
# properties:
props(plt, id="rowhead_right") <- element_hvrule(enabled=TRUE, linetype=1,
color="black", space=10)
plt
# Change the properties of all enabled hvrules:
propsd(plt, subset=(enabled)) <- element_hvrule(color="red")
plt
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.