ecmerkle / blavaan

An R package for Bayesian structural equation modeling
https://ecmerkle.github.io/blavaan
86 stars 23 forks source link

lavaan ERROR: unknown argument `cat.wls.w' #91

Open YP-Hao opened 1 week ago

YP-Hao commented 1 week ago

Got the following error: error in lavaan("\n inorganic.N~treat\n pH~treat\n Moisture~treat\n Leaf.N~inorganic.N\n NRE~inorganic.N\npH~inorganic.N\n biomass~Leaf.N\n litter_mass~biomass+NRE\n Moisture~litter_mass\n litter_n~Leaf.N+NRE\n inorganic.N~litter_n\n \n ", : lavaan ERROR: unknown argument `cat.wls.w'

Same script as before: model1 <-' inorganic.N~treat pH~treat Moisture~treat Leaf.N~inorganic.N NRE~inorganic.N pH~inorganic.N biomass~Leaf.N litter_mass~biomass+NRE Moisture~litter_mass litter_n~Leaf.N+NRE inorganic.N~litter_n

'

fit1 <- bsem(model1, data = data1,cp = "srs", sample=1000, target = "jags")

ecmerkle commented 6 days ago

Thanks for the report. The "cat.wls.w" argument is pretty new to lavaan, and I suspect you need to upgrade lavaan to version 0.6-18 or 0.6-19. I just updated this version dependency (was previously set to >= 0.6-17).

If you have done that and this error still appears, then I would guess that R is using an old version of lavaan that is still lurking somewhere on your system. Sometimes it helps to look at the .libPaths() command, which lists the directories where packages are installed on your system.