removeFilter: Remove a worksheet filter

Description Usage Arguments Examples

View source: R/wrappers.R

Description

Removes filters from addFilter() and writeData()

Usage

1
removeFilter(wb, sheet)

Arguments

wb

A workbook object

sheet

A vector of names or indices of worksheets

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
wb <- createWorkbook()
addWorksheet(wb, "Sheet 1")
addWorksheet(wb, "Sheet 2")
addWorksheet(wb, "Sheet 3")

writeData(wb, 1, iris)
addFilter(wb, 1, row = 1, cols = 1:ncol(iris))

## Equivalently
writeData(wb, 2, x = iris, withFilter = TRUE)

## Similarly
writeDataTable(wb, 3, iris)

## remove filters
removeFilter(wb, 1:2) ## remove filters
removeFilter(wb, 3) ## Does not affect tables!
## Not run: 
saveWorkbook(wb, file = "removeFilterExample.xlsx", overwrite = TRUE)

## End(Not run)

Example output

Note: zip::zip() is deprecated, please use zip::zipr() instead

openxlsx documentation built on June 16, 2021, 9:06 a.m.