filter_spec: Filter a spec object

View source: R/spec.R

filter_specR Documentation

Filter a spec object

Description

Filter a spec object

Usage

filter_spec(spec, filter_expr, verbose = TRUE)

Arguments

spec

A 'spec' object as returned by 'read_spec()'

filter_expr

A 'logical' expression indicating outputs to keep

verbose

Should a message about the number of outputs matching 'filter_spec' be printed? Defaults to 'TRUE'.

Value

A 'spec' object containing only the outputs matching 'filter_expr'

Author(s)

Thomas Neitmann ('neitmant')

Examples

library(dplyr)
spec_file <- system.file("spec.yml", package = "autoslider.core")
spec <- spec_file %>% read_spec()

## Keep only the t_dm_IT output
filter_spec(spec, output == "t_dm_IT")

## Same as above but more verbose
filter_spec(spec, program == "t_dm" && suffix == "IT")

## Keep all t_ae outputs
filter_spec(spec, program == "t_ae")

## Keep all output run on safety population
filter_spec(spec, "SE" %in% suffix)

## Keep t_dm_CHN_IT and t_dm_CHN_SE
filter_spec(spec, program == "t_dm" && suffix %in% c("CHN_IT", "CHN_SE"))

## Keep all tables
filter_spec(spec, grepl("^t_", program))


autoslider.core documentation built on April 4, 2025, 2:05 a.m.