Learn R Programming

openxlsx (version 4.2.7.1)

groupColumns: Group columns

Description

Group a selection of columns

Usage

groupColumns(wb, sheet, cols, hidden = FALSE, level = -1)

Arguments

wb

A workbook object.

sheet

A name or index of a worksheet.

cols

Indices of cols to group. Can be either a vector of indices to group at the same level or a (named) list of numeric vectors of indices to create multiple groupings at once. The names of the entries determine the grouping level. If no names are given, the level parameter is used as default.

hidden

Logical vector. If TRUE the grouped columns are hidden. Defaults to FALSE.

level

Grouping level (higher value indicates multiple nestings) for the group. A vector to assign different grouping levels to the indices. A value of -1 indicates that the grouping level should be derived from the existing grouping (one level added)

Author

Joshua Sturm, Reinhold Kainhofer

Details

Group columns together, with the option to hide them.

NOTE: setColWidths() has a conflicting hidden parameter; changing one will update the other.

See Also

ungroupColumns() to ungroup columns. groupRows() for grouping rows.