View source: R/8-conversion-functions.R
as.character.parentslist | R Documentation |
Nice print of a parentslist object
## S3 method for class 'parentslist' as.character(x, only_parents = FALSE, ...) ## S3 method for class 'parentslist' print(x, ...)
x |
an object of class |
only_parents |
logical, if the basic DAG encoding is to be returned. |
... |
additional arguments for compatibility. |
as.character.parentslist
returns a string
encoding the associated directed graph and eventually
the context specific independences.
The encoding is similar to the one returned by
modelstring
in package bnlearn
and package deal.
In particular, parents of a variable can be enclosed in:
( )
if a partial (conditional) independence is present.
{ }
if a context specific independence is present.
< >
if no context specific and partial (conditional)
independences are present, but at least a
local independence is detected.
If a parent is not enclosed in parenthesis the dependence is full.
If only_parents = TRUE
, the simple DAG encoding as in bnlearn
is returned.
model <- stages_hclust(full(Titanic), k = 2) pl <- as_parentslist(model) pl as.character(pl) as.character(pl, only_parents = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.