filterResult: Filter a <summarised_result> automatically

View source: R/filter.R

filterResultR Documentation

Filter a ⁠<summarised_result>⁠ automatically

Description

Filter a ⁠<summarised_result>⁠ automatically

Usage

filterResult(result, ...)

Arguments

result

A ⁠<summarised_result>⁠ object.

...

Expressions that return a logical value. The columns used in the expressions can be stored in the settings, strata, group, or additional columns. filterResult() looks for columns using this hierarchy: settings, strata, group, then additional. If multiple expressions are included, they are combined with the & operator. Only rows for which all conditions evaluate to TRUE are kept.

Value

A ⁠<summarised_result>⁠ object with only the rows that satisfy the specified filters.

Examples

library(dplyr)
library(omopgenerics)

x <- tibble(
  "result_id" = 1L,
  "cdm_name" = "eunomia",
  "group_name" = "cohort_name",
  "group_level" = "my_cohort",
  "strata_name" = "sex",
  "strata_level" = "Female",
  "variable_name" = "number subjects",
  "variable_level" = NA_character_,
  "estimate_name" = "count",
  "estimate_type" = "integer",
  "estimate_value" = "100",
  "additional_name" = "overall",
  "additional_level" = "overall"
) |>
  newSummarisedResult(settings = tibble(
    "result_id" = 1L, "analysis" = "overall"
  ))

x |>
  filterResult(cohort_name == "my_cohort", sex == "Female")


omopgenerics documentation built on June 17, 2026, 5:07 p.m.