tbates / umx

Making Structural Equation Modeling (SEM) in R quick & powerful
https://tbates.github.io/
44 stars 17 forks source link

warning messages when specifying lists of confidence intervals #136

Closed khusmann closed 3 years ago

khusmann commented 3 years ago

Hi, it's me again :)

Getting these warning messages when specifying lists of confidence intervals:

require(umx)
data(demoOneFactor)
manifests = names(demoOneFactor)
m1 = umxRAM("One Factor", data = demoOneFactor, type = "cov",
    umxPath("G", to = manifests),
    umxPath(var = manifests),
    umxPath(var = "G", fixedAt = 1)
)
m1 = umxCI(m1, c("x1_with_x1", "x2_with_x2"), run= "yes")

Output is as expected, but with warnings:

1: In if (is.na(which)) { :
  the condition has length > 1 and only the first element will be used
2: In if (which == "ALL") { :
  the condition has length > 1 and only the first element will be used

Looks like those are coming from https://github.com/tbates/umx/blob/master/R/fit_and_reporting.R#L754 and https://github.com/tbates/umx/blob/master/R/fit_and_reporting.R#L738

Perhaps there should be a different arg-checking flow when which is a vector?

tbates commented 3 years ago

should have had a test case for that. Fixed now!

khusmann commented 3 years ago

Thanks!!