Learn R Programming

SEMgraph (version 1.2.2)

graph2lavaan: Graph to lavaan model

Description

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

Usage

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

Value

A model in lavaan syntax.

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.

Author

Mario Grassi mario.grassi@unipv.it

Examples

Run this code

# Graph (igraph object) to structural model in lavaan syntax
model <- graph2lavaan(sachs$graph)
cat(model, "\n")

Run the code above in your browser using DataLab