Add excel column filters to a worksheet
addFilter(wb, sheet, rows, cols)
adds filters to worksheet columns, same as filter parameters in writeData. writeDataTable automatically adds filters to first row of a table. NOTE Can only have a single filter per worksheet unless using tables.
addFilter()
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)
if (FALSE) { # \dontrun{
saveWorkbook(wb, file = "addFilterExample.xlsx", overwrite = TRUE)
} # }