if (FALSE) {
# Load workbook (create if not existing)
wb <- loadWorkbook("isSheetHidden.xlsx", create = TRUE)
# Write a couple of built-in data.frame's into sheets
# with corresponding name
for(obj in c("CO2", "airquality", "swiss")) {
createSheet(wb, name = obj)
writeWorksheet(wb, get(obj), sheet = obj)
}
# Hide sheet 'airquality'
hideSheet(wb, sheet = "airquality")
# Check if sheet 'airquality' is hidden;
# this should obviously return TRUE
isSheetHidden(wb, "airquality")
# Check if sheet 'swiss' is hidden;
# this should obviously return FALSE
isSheetHidden(wb, "swiss")
# clean up
file.remove("isSheetHidden.xlsx")
}
Run the code above in your browser using DataLab