add_column_headings {grobblR} | R Documentation |
Add column headings to grob matrix
Description
Add column headings onto an object initialized by grob_matrix
.
Usage
add_column_headings(mat, headings = list(), heading_cols = list())
Arguments
mat |
The grob matrix object the column headings will be added onto. |
headings |
The headings to be added onto the initial matrix,
in a list with each heading a separate element. The list must have
the same amount of elements as the |
heading_cols |
Which column positions of the initial matrix the Can either be numeric indices, or column names of the initial data frame / matrix
passed through Default is an empty list. If unaltered, the function will assume the user
wants to apply |
Details
The user must add column headings before adding or altering any aesthetics.
Value
The initial grob matrix object with column headings inserted into the appropriate areas.
Examples
data.frame(var1 = c(5, 14, 6, 10), var2 = c(3, 30, 17, 7)) %>%
grob_matrix() %>%
add_column_headings(c('HEADING')) %>%
view_grob()