add_object | R Documentation |
Add a fit object (e.g., 'lavaan' output) to the a 'qgraph' object as an attribute.
add_object(semPaths_plot, object)
semPaths_plot |
A
qgraph::qgraph object generated by
|
object |
Should be the object,
such as the output of |
It adds an object to
a qgraph::qgraph object as the
attribute "semptools_fit_object"
,
to be retrieved by other functions
that need to access the original
output used in semPlot::semPaths()
to create a diagram.
The original qgraph::qgraph object
set to semPaths_plot
, with the
attribute "semptools_fit_object"
set to object
.
semPlot::semPaths()
library(lavaan)
library(semPlot)
mod <-
'f1 =~ x01 + x02 + x03 + x06
f2 =~ x04 + x05 + x06 + x07
f3 =~ x08 + x09 + x10 + x03
f4 =~ x11 + x12 + x13 + x14
'
fit <- lavaan::cfa(mod, cfa_example)
p <- semPaths(fit,
whatLabels = "est",
sizeMan = 3.25,
node.width = 1,
edge.label.cex = .75,
mar = c(10, 5, 10, 5),
DoNotPlot = TRUE)
p <- add_object(p, fit)
attr(p, "semptools_fit_object")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.