Title: | Graphical User Interface with Integrated 'Diagrammer' for 'Lavaan' |
---|---|
Description: | Provides a graphical user interface with an integrated diagrammer for latent variables from the 'lavaan' package. It offers two core functions: first, lavaangui() launches a web application that allows users to specify models by drawing path diagrams, fitting them, assessing model fit, and more; second, plot_lavaan() creates interactive path diagrams from models specified in 'lavaan'. Karch (2024) <doi: 10.31234/osf.io/f4ary> contains a tutorial. |
Authors: | Julian D. Karch [aut, cre, cph] |
Maintainer: | Julian D. Karch <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.2.1 |
Built: | 2024-12-05 16:40:47 UTC |
Source: | CRAN |
The lavaangui
function launches the lavaangui Shiny application.
lavaangui(fit = NULL)
lavaangui(fit = NULL)
fit |
A lavaan model, as returned by the |
Currently, multiple-group models are not supported. However, you can create an
interactive plot of those models using plot_lavaan
nothing
# Without importing lavaan model lavaangui() # Importing a lavaan model library(lavaan) model <- " visual =~ x1 + loadingx2*x2 + x3 textual =~ x4 + x5 + x6 speed =~ x7 + x8 + x9 " fit <- cfa(model, data = HolzingerSwineford1939) lavaangui(fit)
# Without importing lavaan model lavaangui() # Importing a lavaan model library(lavaan) model <- " visual =~ x1 + loadingx2*x2 + x3 textual =~ x4 + x5 + x6 speed =~ x7 + x8 + x9 " fit <- cfa(model, data = HolzingerSwineford1939) lavaangui(fit)
The plot_lavaan
function creates path diagrams for lavaan model.
The created paths diagrams are interactive.
That is, their appearance can be customized easily, for example, by dragging
around nodes representing variable with the mouse.
plot_lavaan(fit, where = "gadget")
plot_lavaan(fit, where = "gadget")
fit |
A lavaan model, as returned by the functions |
where |
A character string to specify where the path diagram should be shown. The default value "gadget" shows it directly in Rstudio. For "browser", it's shown in your default browser. For non-RStudio users, the parameter has no effect, and the path diagram is always shown in the browser. |
nothing
library(lavaan) model <- ' visual =~ x1 + loadingx2*x2 + x3 textual =~ x4 + x5 + x6 speed =~ x7 + x8 + x9 ' fit <- cfa(model, data = HolzingerSwineford1939) plot_lavaan(fit)
library(lavaan) model <- ' visual =~ x1 + loadingx2*x2 + x3 textual =~ x4 + x5 + x6 speed =~ x7 + x8 + x9 ' fit <- cfa(model, data = HolzingerSwineford1939) plot_lavaan(fit)