1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/wrappers.R
\name{addFilter}
\alias{addFilter}
\title{Add column filters}
\usage{
addFilter(wb, sheet, rows, cols)
}
\arguments{
\item{wb}{A workbook object}
\item{sheet}{A name or index of a worksheet}
\item{rows}{A row number.}
\item{cols}{columns to add filter to.}
}
\description{
Add excel column filters to a worksheet
}
\details{
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.
}
\examples{
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)
\dontrun{
saveWorkbook(wb, file = "addFilterExample.xlsx", overwrite = TRUE)
}
}
\seealso{
\code{\link[=writeData]{writeData()}}
\code{\link[=addFilter]{addFilter()}}
}
|