Skip to contents

Plots lavaan path model with DiagrammeR

Usage

lavaanPlot(model, name = "plot", labels = NULL, ...)

Arguments

model

A model fit object of class lavaan.

name

A string of the name of the plot.

labels

An optional named list of variable labels.

...

Additional arguments to be called to buildCall and buildPaths

Value

A Diagrammer plot of the path diagram for model

Examples

library(lavaan)
model <- 'mpg ~ cyl + disp + hp
          qsec ~ disp + hp + wt'
fit <- sem(model, data = mtcars)
lavaanPlot(model = fit, node_options = list(shape = "box", fontname = "Helvetica"),
 edge_options = list(color = "grey"), coefs = FALSE)