View source: R/outputParamFig.R
outputParamFig | R Documentation |
This function takes the model from fitted dySEM
scripts and exports .png
path diagram figures of expected output.
outputParamFig(fit, figtype = NULL, writeTo = NULL, fileName = NULL)
fit |
Input object from fitted |
figtype |
A character input of what type of model is desired:
|
writeTo |
A character string specifying a directory path to where the output file of the path diagram should be saved.
If set to “.”, the file will be written to the current working directory.
The default is |
fileName |
A character string specifying a desired base name for the output file.
If a |
The function uses semPlot::semPaths()
to create a qgraph
object of the desired SEM path diagram.
After execution, a semPlot::semPaths()
message will be printed to the console confirming the directory path of the saved output file.
If a file with the same name already exists in the user's chosen directory, it will be overwritten.
A qgraph
object of the desired SEM path diagram, which is simultaneously exported as a .png
file to the specified directory.
dvnx <- scrapeVarCross(dat = commitmentQ, x_order = "spi", x_stem = "sat.g", x_delim1 = ".",
x_delim2="_", distinguish_1="1", distinguish_2="2")
sat.config.script <- scriptCFA(dvnx, lvname = "Sat", constr_dy_meas = "none",
constr_dy_struct = "none")
sat.config.mod <- lavaan::cfa(sat.config.script, data = commitmentQ, std.lv = FALSE,
auto.fix.first= FALSE, meanstructure = TRUE)
outputParamFig(sat.config.mod, figtype = "standardized",
writeTo = tempdir(), fileName = "dCFA_configural")
dvnxy <- scrapeVarCross(dat = commitmentQ, x_order = "spi", x_stem = "sat.g", x_delim1 = ".",
x_delim2="_", distinguish_1="1", distinguish_2="2",
y_order="spi", y_stem="com", y_delim1 = ".", y_delim2="_")
apim.indist.script <- scriptAPIM(dvnxy, lvxname = "Sat", lvyname = "Com", est_k = TRUE)
apim.indist.mod <- lavaan::cfa(apim.indist.script, data = commitmentQ, std.lv = FALSE,
auto.fix.first= FALSE, meanstructure = TRUE)
outputParamFig(apim.indist.mod, figtype = "standardized",
writeTo = tempdir(), fileName = "APIM_indist")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.