Learn R Programming

openxlsx2 (version 0.6.1)

wb_set_row_heights: Set worksheet row heights

Description

Set worksheet row heights

Usage

wb_set_row_heights(
  wb,
  sheet = current_sheet(),
  rows,
  heights = NULL,
  hidden = FALSE
)

Arguments

wb

A wbWorkbook object

sheet

A name or index of a worksheet

rows

Indices of rows to set height

heights

Heights to set rows to specified in Excel column height units.

hidden

Option to hide rows.

See Also

wb_remove_row_heights()

Other workbook wrappers: wb_add_chartsheet(), wb_add_data_table(), wb_add_data(), wb_add_formula(), wb_add_pivot_table(), wb_add_worksheet(), wb_clone_worksheet(), wb_copy_cells(), wb_creators, wb_freeze_pane(), wb_get_base_font(), wb_save(), wb_set_col_widths(), wb_set_last_modified_by(), wb_workbook(), workbook_grouping, ws_cell_merge

Examples

Run this code
## Create a new workbook
wb <- wb_workbook()

## Add a worksheet
wb$add_worksheet("Sheet 1")

## set row heights
wb <- wb_set_row_heights(
  wb, 1,
  rows = c(1, 4, 22, 2, 19),
  heights = c(24, 28, 32, 42, 33)
)

## overwrite row 1 height
wb <- wb_set_row_heights(wb, 1, rows = 1, heights = 40)

Run the code above in your browser using DataLab