Learn R Programming

lavaanPlot (version 0.8.1)

lavaanPlot: Plots lavaan path model with DiagrammeR

Description

Plots lavaan path model with DiagrammeR

Usage

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

Value

A Diagrammer plot of the path diagram for model

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

Examples

Run this code
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)

Run the code above in your browser using DataLab