Running examples in 'lavaSearch2-Ex.R' failed
The error most likely occurred in:

> ### Name: createContrast
> ### Title: Create Contrast matrix
> ### Aliases: createContrast createContrast.character createContrast.lm
> ###   createContrast.gls createContrast.lme createContrast.lvmfit
> ###   createContrast.list createContrast.mmm
> 
> ### ** Examples
> 
> ## Simulate data
> mSim <- lvm(X ~ Age + Treatment,
+             Y ~ Gender + Treatment,
+             c(Z1,Z2,Z3) ~ eta, eta ~ treatment,
+             Age[40:5]~1)
> latent(mSim) <- ~eta
> categorical(mSim, labels = c("placebo","SSRI")) <- ~Treatment
> categorical(mSim, labels = c("male","female")) <- ~Gender
> n <- 1e2
> set.seed(10)
> df.data <- sim(mSim,n)
> 
> ## Estimate separate models
> lmX <- estimate(lvm(X ~ -1 + Age + Treatment), data = df.data)
> lmY <- estimate(lvm(Y ~ -1 + Gender + Treatment), data = df.data)
> lvmZ <- estimate(lvm(c(Z1,Z2,Z3) ~ -1 + 1*eta, eta ~ -1 + Treatment), 
+                  data = df.data)
> 
> ## Contrast matrix for a given model
> createContrast(lmX, par = "X~Age")
$contrast
            X~Age X~TreatmentSSRI X~~X
[X~Age] = 0     1               0    0

$null
[X~Age] = 0 
          0 

$Q
[1] 1

> createContrast(lmX, par = c("X~Age=0","X~Age+5*X~TreatmentSSRI=0"))
$contrast
                                X~Age X~TreatmentSSRI X~~X
[X~Age] = 0                         1               0    0
[X~Age + 5*X~TreatmentSSRI] = 0     1               5    0

$null
                    [X~Age] = 0 [X~Age + 5*X~TreatmentSSRI] = 0 
                              0                               0 

$Q
[1] 2

> createContrast(lmX, par = character(0))
$contrast
     X~Age X~TreatmentSSRI X~~X

$null
logical(0)

$Q
[1] 0

> 
> ## Contrast matrix for the join model
> ls.lvm <- list(X = lmX, Y = lmY, Z = lvmZ)
> createContrast(ls.lvm, var.test = "Treatment")
$contrast
                     X: X~Age X: X~TreatmentSSRI X: X~~X Y: Y~Genderfemale
X: X~TreatmentSSRI          0                  1       0                 0
Y: Y~TreatmentSSRI          0                  0       0                 0
Z: eta~TreatmentSSRI        0                  0       0                 0
                     Y: Y~TreatmentSSRI Y: Y~~Y Z: eta~TreatmentSSRI Z: Z1~~Z1
X: X~TreatmentSSRI                    0       0                    0         0
Y: Y~TreatmentSSRI                    1       0                    0         0
Z: eta~TreatmentSSRI                  0       0                    1         0
                     Z: Z2~~Z2 Z: Z3~~Z3 Z: eta~~eta
X: X~TreatmentSSRI           0         0           0
Y: Y~TreatmentSSRI           0         0           0
Z: eta~TreatmentSSRI         0         0           0

$null
  X: X~TreatmentSSRI   Y: Y~TreatmentSSRI Z: eta~TreatmentSSRI 
                   0                    0                    0 

$Q
[1] 3

$mlf
$X
                X~Age X~TreatmentSSRI X~~X
X~TreatmentSSRI     0               1    0

$Y
                Y~Genderfemale Y~TreatmentSSRI Y~~Y
Y~TreatmentSSRI              0               1    0

$Z
                  eta~TreatmentSSRI Z1~~Z1 Z2~~Z2 Z3~~Z3 eta~~eta
eta~TreatmentSSRI                 1      0      0      0        0

attr(,"class")
[1] "mlf"

> createContrast(ls.lvm, par = character(0))
Error in rowSums(iContrast != 0) : 
  'x' must be an array of at least two dimensions
Calls: createContrast ... createContrast.list -> lapply -> FUN -> which -> rowSums
Execution halted