Learn R Programming

CausalQueries (version 0.0.3)

restrict_by_query: Reduce nodal types

Description

Reduce nodal types

Usage

restrict_by_query(model, statement, join_by = "|", keep = FALSE)

Arguments

model

a model created by make_model()

statement

a list of character vectors specifying nodal types to be removed from the model. Use get_nodal_types to see syntax.

join_by

A string or a list of strings. The logical operator joining expanded types when statement contains wildcard (.). Can take values '&' (logical AND) or '|' (logical OR). When restriction contains wildcard (.) and join_by is not specified, it defaults to '|', otherwise it defaults to NULL.

keep

Logical. If `FALSE`, removes and if `TRUE` keeps only causal types specified by restriction.

Value

An object of class causal_model. The causal types and nodal types in the model are reduced according to the stated restriction.

See Also

Other restrictions: restrict_by_labels(), set_restrictions()