imed_filter: Filter IMED with scientific guard metadata retained

View source: R/filter_guard.R

imed_filterR Documentation

Filter IMED with scientific guard metadata retained

Description

Filter IMED with scientific guard metadata retained

Usage

imed_filter(
  x,
  matrix = NULL,
  comparability_class = NULL,
  mass_basis = NULL,
  metric_type = NULL,
  study_id = NULL,
  include_holds = FALSE
)

Arguments

x

An 'imed_db' (HOLD flags are added automatically) or a measurement-level data frame.

matrix

Optional 'Matrix_Code' value(s) to keep.

comparability_class

Optional 'Comparability_Class' value(s) to keep.

mass_basis

Optional 'Mass_Basis' value(s) to keep.

metric_type

Optional 'Metric_Type' value(s) to keep.

study_id

Optional character vector of 'Study_ID' values used to restrict the records.

include_holds

If 'FALSE' (default), records flagged as scientific HOLDs are removed.

Value

A 'tibble' of the records that satisfy all supplied filters. If 'x' is an 'imed_db', the result is the measurement-level table with comparability metadata and two added columns: '.imed_hold' (logical) and '.imed_hold_reason' (character).

Examples

db <- imed_data(tables = c("MEASUREMENTS", "MEASUREMENT_COMPARABILITY"),
                validate = FALSE)
nrow(imed_filter(db))
nrow(imed_filter(db, include_holds = TRUE))

imedR documentation built on Nov. 3, 2026, 5:08 p.m.