Learn R Programming

openxlsx2 (version 0.6.1)

sheet_visibility: Get/set worksheet visible state

Description

Get and set worksheet visible state

Usage

wb_get_sheet_visibility(wb)

wb_set_sheet_visibility(wb, sheet = current_sheet(), value)

Value

Character vector of worksheet names.

Vector of "hidden", "visible", "veryHidden"

Arguments

wb

A wbWorkbook object

sheet

Worksheet identifier

value

a logical/character vector the same length as sheet

Examples

Run this code

wb <- wb_workbook()
wb$add_worksheet(sheet = "S1", visible = FALSE)
wb$add_worksheet(sheet = "S2", visible = TRUE)
wb$add_worksheet(sheet = "S3", visible = FALSE)

wb$get_sheet_visibility()
wb$set_sheet_visibility(1, TRUE)         ## show sheet 1
wb$set_sheet_visibility(2, FALSE)        ## hide sheet 2
wb$set_sheet_visibility(3, "hidden")     ## hide sheet 3
wb$set_sheet_visibility(3, "veryHidden") ## hide sheet 3 from UI

Run the code above in your browser using DataLab