Learn R Programming

openxlsx2 (version 0.8)

wb_freeze_pane: Freeze a worksheet pane

Description

Freeze a worksheet pane

Usage

wb_freeze_pane(
  wb,
  sheet = current_sheet(),
  first_active_row = NULL,
  first_active_col = NULL,
  first_row = FALSE,
  first_col = FALSE,
  ...
)

Arguments

wb

A workbook object

sheet

A name or index of a worksheet

first_active_row

Top row of active region

first_active_col

Furthest left column of active region

first_row

If TRUE, freezes the first row (equivalent to firstActiveRow = 2)

first_col

If TRUE, freezes the first column (equivalent to firstActiveCol = 2)

...

additional arguments

See Also

Other workbook wrappers: wb_add_chartsheet(), wb_add_data_table(), wb_add_data(), wb_add_formula(), wb_add_pivot_table(), wb_add_worksheet(), wb_base_font, wb_clone_worksheet(), wb_col_widths, wb_copy_cells(), wb_creators, wb_grouping, wb_merge_cells(), wb_save(), wb_set_last_modified_by(), wb_set_row_heights(), wb_workbook()

Examples

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

## Add some worksheets
wb$add_worksheet("Sheet 1")
wb$add_worksheet("Sheet 2")
wb$add_worksheet("Sheet 3")
wb$add_worksheet("Sheet 4")

## Freeze Panes
wb$freeze_pane("Sheet 1", firstActiveRow = 5, firstActiveCol = 3)
wb$freeze_pane("Sheet 2", firstCol = TRUE) ## shortcut to firstActiveCol = 2
wb$freeze_pane(3, firstRow = TRUE) ## shortcut to firstActiveRow = 2
wb$freeze_pane(4, firstActiveRow = 1, firstActiveCol = "D")

Run the code above in your browser using DataLab