Convert an igraph object to a model (lavaan syntax).

graph2lavaan(graph, nodes = V(graph)$name, ...)

Arguments

graph

A graph as an igraph object.

nodes

Subset of nodes to be included in the model. By default, all the input graph nodes will be included in the output model.

...

Currently ignored.

Value

A model in lavaan syntax.

Author

Mario Grassi mario.grassi@unipv.it

Examples


# Graph (igraph object) to structural model in lavaan syntax
model <- graph2lavaan(sachs$graph)
cat(model, "\n")
#> Akt~PIP3
#> Akt~PKA
#> Erk~Mek
#> Erk~PKA
#> Jnk~PKA
#> Jnk~PKC
#> Mek~PKA
#> Mek~PKC
#> Mek~Raf
#> P38~PKA
#> P38~PKC
#> PIP2~PIP3
#> PIP2~Plcg
#> PKC~PIP2
#> PKC~Plcg
#> Plcg~PIP3
#> Raf~PKA
#> Raf~PKC
#> PKA~~PIP3