setFilter {tabshiftr} | R Documentation |
Set filters
Description
This function allows to specify additional rules to filter certain rows
Usage
setFilter(schema = NULL, rows = NULL, columns = NULL, operator = NULL)
Arguments
schema |
[ |
rows |
[ |
columns |
[ |
operator |
[ |
Value
An object of class schema
.
See Also
Other functions to describe table arrangement:
setCluster()
,
setFormat()
,
setGroups()
,
setIDVar()
,
setObsVar()
Examples
(input <- tabs2shift$messy_rows)
# select rows where there is 'unit 2' in column 1 or 'year 2' in column 2
schema <-
setFilter(rows = .find(pattern = "unit 2", col = 1)) %>%
setFilter(rows = .find(pattern = "year 2", col = 2), operator = `|`) %>%
setIDVar(name = "territories", columns = 1) %>%
setIDVar(name = "year", columns = 2) %>%
setIDVar(name = "commodities", columns = 3) %>%
setObsVar(name = "harvested", columns = 5) %>%
setObsVar(name = "production", columns = 6)
reorganise(schema = schema, input = input)
[Package tabshiftr version 0.4.1 Index]