
Generate filters definition based on the Source data
Source:R/source_methods.R, R/source_tblist.R
autofilter.RdThe method should analyze source data structure, generate proper filters based on the data (e.g. column types) and attach them to source.
Examples
library(cohortBuilder)
iris_source <- set_source(tblist(iris = iris)) |>
autofilter()
iris_cohort <- cohort(iris_source)
sum_up(iris_cohort)
#> >> Step ID: 1 [pending]
#> -> Filter ID: iris-SepalLength
#> Filter Type: range
#> Filter Parameters:
#> active: TRUE
#> description:
#> domain: 4.3, 7.9
#> dataset: iris
#> variable: Sepal.Length
#> range: NA
#> keep_na: TRUE
#> -> Filter ID: iris-SepalWidth
#> Filter Type: range
#> Filter Parameters:
#> active: TRUE
#> description:
#> domain: 2, 4.4
#> dataset: iris
#> variable: Sepal.Width
#> range: NA
#> keep_na: TRUE
#> -> Filter ID: iris-PetalLength
#> Filter Type: range
#> Filter Parameters:
#> active: TRUE
#> description:
#> domain: 1, 6.9
#> dataset: iris
#> variable: Petal.Length
#> range: NA
#> keep_na: TRUE
#> -> Filter ID: iris-PetalWidth
#> Filter Type: range
#> Filter Parameters:
#> active: TRUE
#> description:
#> domain: 0.1, 2.5
#> dataset: iris
#> variable: Petal.Width
#> range: NA
#> keep_na: TRUE
#> -> Filter ID: iris-Species
#> Filter Type: discrete
#> Filter Parameters:
#> active: TRUE
#> description:
#> domain: setosa, versicolor, virginica
#> dataset: iris
#> variable: Species
#> value: NA
#> keep_na: TRUE