View source: R/knowledge-verbs.R
| unfreeze | R Documentation |
This allows you to add new variables to the Knowledge object,
even though it was frozen earlier by adding a data frame to the knowledge
constructor knowledge().
unfreeze(kn)
kn |
A |
The same Knowledge object with the frozen attribute set to
FALSE.
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(),
reposition_tier(),
require_edge(),
seq_tiers()
# unfreeze allows adding variables beyond the original data frame columns
data(tpc_example)
kn <- knowledge(tpc_example)
# this would error while frozen
try(add_vars(kn, "new_var"))
# unfreeze and add the new variable successfully
kn <- unfreeze(kn)
kn <- add_vars(kn, "new_var")
print(kn)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.