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_interactive() 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.1.2 |
Built: | 2024-11-12 04:56:44 UTC |
Source: | https://github.com/karchjd/lavaangui |
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_interactive
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_interactive
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_interactive(fit, where = "gadget")
plot_interactive(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_interactive(fit)
library(lavaan) model <- ' visual =~ x1 + loadingx2*x2 + x3 textual =~ x4 + x5 + x6 speed =~ x7 + x8 + x9 ' fit <- cfa(model, data = HolzingerSwineford1939) plot_interactive(fit)