dr-JT / semoutput

Create nice looking output for CFA and SEM analyses using lavaan and semPlot packages
https://dr-jt.github.io/semoutput/
20 stars 3 forks source link

Error: Problem with sem_factorcor() and sem_factorvar() #4

Closed iron-hong closed 3 years ago

iron-hong commented 3 years ago

Hello, thanks for your great package!

I'm currently running semoutput package for my work. Everything went smoothly enough until after trying to analyze the latent factor correlation and residual variance. To which I get an error that says:

sem_factorcor(fit, factors = factors) Error: Problem with filter() input ..2. i Input ..2 is lhs %in% factors. x object 'factors' not found Run rlang::last_error() to see where the error occurred.

sem_factorvar(fit, factors = factors) Error: Problem with filter() input ..2. i Input ..2 is lhs %in% factors. x object 'factors' not found Run rlang::last_error() to see where the error occurred.

What seems to be the problem? I tried to reinstall library(semoutput) again, but the same error appears.

Thank you very much in advance.

dr-JT commented 3 years ago

The functions need you to specify a list c() of latent factor labels that were used in the lavaan model. Thinking of it now, I really should remove the need to do that and automatically figure out the labels of the latent factors. Though I may have had some reason for doing this.

dr-JT commented 3 years ago

I updated the package so that the functions no longer require the argument factors = c(). It will automatically detect the latent factor labels from the model.

iron-hong commented 3 years ago

Thank you so much for the quick update. I just tried the function, and it worked!