Learn R Programming

lavaanPlot (version 0.8.1)

embed_plot_pdf: Embeds a plot into an rmarkdown pdf

Description

Embeds a plot into an rmarkdown pdf

Usage

embed_plot_pdf(plot, path, width = NULL, height = NULL)

Value

no return value calls include_graphics to embed plot in pdf

Arguments

plot

plot object created by lavaanPlot

path

Filename to save the image

width

width of image in pixels, NULL for default

height

height of image, NULL for default

Examples

Run this code
library(lavaan)
model <- 'mpg ~ cyl + disp + hp
          qsec ~ disp + hp + wt'
fit <- sem(model, data = mtcars)
pl <- lavaanPlot(model = fit)
if (FALSE) {
embed_plot_pdf(pl, "plot2.pdf")
}

Run the code above in your browser using DataLab