Filter a named list of workflows by matching zero or more meta fields
against supplied values. Each name = value pair in ... is applied
sequentially (AND logic): a workflow must satisfy every filter to be
retained.
Arguments
- lWorkflows
listA named list of workflows, as returned byMakeWorkflowList().- ...
name = valuepairs where each name is ametafield to filter on (e.g.,Category,Type,Active) and the value determines which workflows are kept. Field lookup is case-insensitive. Workflows that lack the specified field entirely are removed. The class of each value controls matching behaviour:character: keep workflows where any element ofmeta[[field]]matches any element ofvalue(case-insensitive).logical: keep workflows wheremeta[[field]]coerces to the givenTRUE/FALSEvalue (coercion handles YAML string forms like"true").numericorinteger: keep workflows wheremeta[[field]]equals any element ofvalue(equality only; no comparison operators).other types: an informative error is raised.
Examples
lWorkflows <- MakeWorkflowList(strPath = "example_workflows", strPackage = "workr")
# Filter by a character field
lWorkflowsAnalysis <- FilterWorkflows(lWorkflows, Type = "Analysis")
#> [INFO] Keeping 1 of 11 workflows where Type matches Analysis.
#> [INFO] Kept 1 of 11 workflows after applying 1 filter(s).
# Multiple filters (AND logic)
lWorkflowsAnalysisSite <- FilterWorkflows(lWorkflows, Type = "Analysis", GroupLevel = "site")
#> [INFO] Keeping 1 of 11 workflows where Type matches Analysis.
#> [INFO] Keeping 1 of 1 workflows where GroupLevel matches site.
#> [INFO] Kept 1 of 11 workflows after applying 2 filter(s).