| as_sevt | R Documentation |
Convert to an equivalent object of class sevt.
as_sevt(x, ...)
## S3 method for class 'bn.fit'
as_sevt(x, order = NULL, ...)
## S3 method for class 'bn'
as_sevt(x, order = NULL, values = NULL, ...)
## S3 method for class 'parentslist'
as_sevt(x, order = NULL, values = NULL, ...)
x |
an R object. |
... |
additional parameters to be used by specific methods. |
order |
order of the variables. |
values |
the values for each variable, the sample space. |
In as_sevt.bn.fit the order
argument, if provided, must be a topological order of the
bn.fit object (no check is performed). If the order is not provided
a topological order will be used (the one returned by
bnlearn::node.ordering).
In as_sevt.parentslist the order
argument, if provided, must be a topological order of the
corresponding DAG (no check is performed).
If the order is not provided
names(x) is used.
The values parameter is used to specify the sample space
of each variable. For a parentslist object created with
as_parentslist from an object of class sevt,
it is, usually, not needed to specify the values parameter,
since the sample space is saved in the parentslist object.
the equivalent object of class sevt.
model <- stages_hclust(full(Titanic), k = 2)
plot(model)
pl <- as_parentslist(model)
model2 <- as_sevt(pl)
plot(model2) ## this is a super-model of the first staged tree
## we can check it with
inclusions_stages(model, model2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.