Converts lavaan syntax or object to graphviz code. Requires 'DiagrammeR' package.
Usage
lav_to_graph(
m,
layout = "dot",
adds = NULL,
file = NA,
rmarkdown = FALSE,
code.only = F,
try.labels = T,
label.wrap = 15,
std = F,
elements = c("obs", "lat.covs", "resid.covs", "resid", "slopes"),
...
)
Arguments
- m
character, following lavaan syntax model conventions (see examples), or fitted lavaan object.
- layout
Can be 'dot', 'neato', 'twopi', 'circo', or 'fdp'
- adds
Any graphviz code to be added to the graph.
- file
character, file name to save svg code, usually with 'svg' extension.
- rmarkdown
Logical. If the function used in the context of Rmarkdown.
- try.labels
Try extracting labels from the data.
- label.wrap
Number of character to wrap a label
- std
Whether include standardized or unstandardized estimates.
- elements
Character vector. What to include in the diagram, possible values "obs", "lat.covs", "resid.covs", "resid", "slopes", and "intercepts/thresholds" (currently not supported).
- ...
arguments passed to DiagrammeR::grViz function.
Value
The function invisibly returns the dot code which can be edited to make more customized diagrams. You can use package DiagrammeR or any other graphviz engine, e.g. http://graphviz.it. It will most likely to be useful with large and complex models.