View source: R/knowledge-manipulation.R
| reposition_tier | R Documentation |
Move a Tier Relative to Another in Knowledge
reposition_tier(kn, tier, before = NULL, after = NULL, by_index = FALSE)
kn |
A |
tier |
The tier to move (label or index, honouring |
before |
Exactly one of these must be supplied and must identify another existing tier. |
after |
Exactly one of these must be supplied and must identify another existing tier. |
by_index |
If |
The 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(),
remove_vars(),
reorder_tiers(),
require_edge(),
seq_tiers(),
unfreeze()
# Move one tier relative to another
data(tpc_example)
kn <- knowledge(
head(tpc_example),
tier(
child ~ starts_with("child"),
youth ~ starts_with("youth"),
oldage ~ starts_with("old")
)
)
kn <- reorder_tiers(kn, c("youth", "child", "oldage"))
print(kn)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.