alishinski / lavaanPlot

R package for plotting lavaan path models with DiagrammeR
http://alexlishinski.com/lavaanPlot/
38 stars 4 forks source link

cov coefs always plotted #18

Closed mattansb closed 4 years ago

mattansb commented 4 years ago

The values of the covariances are always plotted, even when coefs = FALSE - is there a way to suppress this?

library(lavaan)
#> Warning: package 'lavaan' was built under R version 3.6.1
#> This is lavaan 0.6-4
#> lavaan is BETA software! Please report any bugs.
library(lavaanPlot)

model <- '
# measurement model
ind60 =~ x1 + x2 + x3
dem60 =~ y1 + y2 + y3 + y4
dem65 =~ y5 + y6 + y7 + y8
# regressions
dem65 ~~ ind60 + dem60
'

fit <- sem(model, data=PoliticalDemocracy)
lavaanPlot(model = fit, covs = TRUE, coefs = FALSE)

image

mattansb commented 4 years ago

Also, only cov between latent variables is plotted - can this be changed to allow for plotting covs between the observed variables?

willynilly commented 4 years ago

Yes, I really need the covs plotted for observed variables.

alishinski commented 4 years ago

Fixed the original issue. Now coefs plot all or none with coefs = TRUE including covariances.