View source: R/knowledge-verbs.R
| remove_vars | R Documentation |
Drops the given variables from kn$vars, and automatically removes
any edges that mention them.
remove_vars(kn, ...)
kn |
A |
... |
Unquoted variable names or tidy‐select helpers. |
An updated Knowledge object.
Other knowledge functions:
+.Knowledge(),
add_exogenous(),
add_tier(),
add_to_tier(),
add_vars(),
as_bnlearn_knowledge(),
as_pcalg_constraints(),
as_tetrad_knowledge(),
convert_tiers_to_forbidden(),
deparse_knowledge(),
forbid_edge(),
get_tiers(),
knowledge(),
knowledge_to_caugi(),
remove_edge(),
remove_tiers(),
reorder_tiers(),
reposition_tier(),
require_edge(),
seq_tiers(),
unfreeze()
# remove variables and their incident edges
data(tpc_example)
kn <- knowledge(
head(tpc_example),
tier(
child ~ starts_with("child"),
youth ~ starts_with("youth"),
oldage ~ starts_with("old")
),
child_x1 %-->% youth_x3
)
print(kn)
kn <- remove_edge(kn, child_x1, youth_x3)
print(kn)
kn <- remove_vars(kn, starts_with("child_"))
print(kn)
kn <- remove_tiers(kn, "child")
print(kn)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.