View source: R/8-conversion-functions.R
as_parentslist | R Documentation |
Convert to the equivalent representation as list of parents.
as_parentslist(x, ...) ## S3 method for class 'bn' as_parentslist(x, order = NULL, ...) ## S3 method for class 'bn.fit' as_parentslist(x, order = NULL, ...) ## S3 method for class 'sevt' as_parentslist(x, ...)
x |
an R object. |
... |
additional parameters. |
order |
order of the variables, usually a topological order. |
The output of this function is an object of class
parentslist
which is one of the possible encoding for
a directed graph. This is mainly an internal class and its
specification can be changed in the future.
For example, now it may also include information on the
sample space of the variables and the context/partial/local
independences.
In as_parentslist.sevt
, if a context-specific or a local-partial independence is detected
a message is printed and the minimal super-model is returned.
An object of class parentslist
for which a
print method exists.
Basically a list with
one entries for each variable with fields:
parents
The parents of the variable.
context
Where context independences are detected.
partial
Where partial independences are detected.
local
Where no context/partial independences are detected,
but local independences are present.
values
values for the variable.
print.parentslist
and
as.character.parentslist
for the parenthesis-encoding of the
DAG structure and the asymmetric independences.
model <- stages_hclust(full(Titanic), k = 2) pl <- as_parentslist(model) pl$Age
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.