SachaEpskamp / semPlot

Path diagrams and visual analysis of various SEM packages' output
GNU General Public License v2.0
61 stars 20 forks source link

"Error in `*tmp*`[[i]] : subscript out of bounds" in `semPlotModel()` #30

Closed DaniMori closed 4 years ago

DaniMori commented 4 years ago

This error seems to happen every time semPlotModel() is called with a lavaan object, at least on R 4.0.2.

I'm afraid it has to do with the method dispatcher for the class lavaan, which makes it almost impossible to track down the error. I wonder if it is related to the major changes in the R internals in version 4.

I leave a reprex below:

library(psych, quietly = TRUE)
library(lavaan, quietly = TRUE)
library(semPlot, quietly = TRUE)

data("Thurstone")

th_model <- "g =~ Sentences + Vocabulary + Sent.Completion + First.Letters"

th_fit <- cfa(th_model, sample.cov = Thurstone, sample.nobs = 213)

semPaths(th_fit)
#> Error in `*tmp*`[[i]]: subscript out of bounds

Created on 2020-07-09 by the reprex package (v0.3.0)

DaniMori commented 4 years ago

It seems like installing the dev version from github solves it...

SachaEpskamp commented 4 years ago

Thanks! I'll submit it to CRAN!