filterSettings: Filter a <summarised_result> using the settings

View source: R/filter.R

filterSettingsR Documentation

Filter a ⁠<summarised_result>⁠ using the settings

Description

Filter a ⁠<summarised_result>⁠ using the settings

Usage

filterSettings(result, ...)

Arguments

result

A ⁠<summarised_result>⁠ object.

...

Expressions that return a logical value (columns in settings are used to evaluate the expression), and are defined in terms of the variables in .data. 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 result_id rows that fulfill the required specified settings.

Examples

library(dplyr)
library(omopgenerics)

x <- tibble(
  "result_id" = as.integer(c(1, 2)),
  "cdm_name" = c("cprd", "eunomia"),
  "group_name" = "sex",
  "group_level" = "male",
  "strata_name" = "sex",
  "strata_level" = "male",
  "variable_name" = "Age group",
  "variable_level" = "10 to 50",
  "estimate_name" = "count",
  "estimate_type" = "numeric",
  "estimate_value" = "5",
  "additional_name" = "overall",
  "additional_level" = "overall"
) |>
  newSummarisedResult(settings = tibble(
    "result_id" = c(1, 2), "custom" = c("A", "B")
  ))

x

x |> filterSettings(custom == "A")


visOmopResults documentation built on Sept. 24, 2024, 1:08 a.m.