alter_column_names {grobblR} | R Documentation |
Alter column names of a grob matrix
Description
Alter column names of an object initialized by grob_matrix
.
Usage
alter_column_names(
mat,
column_names = list(),
column_name_cols = list(),
group_elements = TRUE
)
Arguments
mat |
The grob matrix object the column names will be edited in. |
column_names |
The replacement column names,
in a list with each column name a separate element. The list must have
the same amount of elements as the |
column_name_cols |
Which column positions of the initial data frame / 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 |
group_elements |
A boolean argument on whether like, adjacent column names should be grouped together. |
Details
The user can only use this function if the initial data frame / matrix
passed through grob_matrix
had column names to begin with.
The underlying column names will be unaffected. So, if the user wants to use
alter_at
afterwards, he/she should select the original column names
and not the replacements from this function.
Value
The initial grob matrix object with column names edited in the appropriate areas.
Examples
data.frame(var1 = c(5, 14, 6, 10), var2 = c(3, 30, 17, 7)) %>%
grob_matrix() %>%
alter_column_names(c('COLUMN NAME')) %>%
view_grob()