add_aesthetic {grobblR} | R Documentation |
Add an Aesthetic
Description
Add an aesthetic to a grob matrix object.
Usage
add_aesthetic(
grob_object,
aesthetic,
value = NULL,
group = c("cells", "column_names", "column_headings")
)
Arguments
grob_object |
The R6 object outputted by either |
aesthetic |
The matrix aesthetic the user wishes to add. |
value |
A single value or a matrix of values the user wants to apply to the group of matrix / text elements for the given aesthetic. If a matrix of values is supplied, then the matrix must be of the same dimensions as the chosen subset of the matrix / text. |
group |
The group of the grob matrix object the user wants to add the aesthetic to. For objects initialized by |
Details
Accepted aesthetics:
- Matrix / Text
-
-
background_alpha
-
background_color
-
border_color
-
border_sides
-
border_width
-
font_face
-
group_elements
-
replace_na
-
round_rect_radius
-
text_align
-
text_cex
-
text_font
-
text_color
-
text_just
-
text_v_align
-
text_v_just
-
text_rot
-
To see descriptions of the aesthetics above, see the documentation of ga_list
.
Value
The R6 object of the grob matrix class with its aesthetics properties altered.
Examples
df = data.frame(var1 = c(5, 14, 6, 10), var2 = c(3, 30, 17, 7))
df %>%
grob_matrix() %>%
add_aesthetic(aesthetic = 'text_color', value = 'red', group = 'cells') %>%
view_grob()