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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: kr-modcomp
> ### Title: Ftest and degrees of freedom based on Kenward-Roger
> ###   approximation
> ### Aliases: KRmodcomp KRmodcomp.lmerMod KRmodcomp.mer KRmodcomp_internal
> ###   kr-modcomp
> ### Keywords: inference models
> 
> ### ** Examples
> 
> 
> (fmLarge <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy))
Linear mixed model fit by REML ['lmerMod']
Formula: Reaction ~ Days + (Days | Subject)
   Data: sleepstudy
REML criterion at convergence: 1743.628
Random effects:
 Groups   Name        Std.Dev. Corr
 Subject  (Intercept) 24.737       
          Days         5.923   0.07
 Residual             25.592       
Number of obs: 180, groups:  Subject, 18
Fixed Effects:
(Intercept)         Days  
     251.41        10.47  
> ## removing Days
> (fmSmall <- lmer(Reaction ~ 1 + (Days|Subject), sleepstudy))
Linear mixed model fit by REML ['lmerMod']
Formula: Reaction ~ 1 + (Days | Subject)
   Data: sleepstudy
REML criterion at convergence: 1769.845
Random effects:
 Groups   Name        Std.Dev. Corr 
 Subject  (Intercept) 25.53         
          Days        11.93    -0.18
 Residual             25.59         
Number of obs: 180, groups:  Subject, 18
Fixed Effects:
(Intercept)  
      257.8  
> anova(fmLarge,fmSmall)
refitting model(s) with ML (instead of REML)
Data: sleepstudy
Models:
fmSmall: Reaction ~ 1 + (Days | Subject)
fmLarge: Reaction ~ Days + (Days | Subject)
        Df    AIC    BIC  logLik deviance  Chisq Chi Df Pr(>Chisq)    
fmSmall  5 1785.5 1801.4 -887.74   1775.5                             
fmLarge  6 1763.9 1783.1 -875.97   1751.9 23.537      1  1.226e-06 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
> KRmodcomp(fmLarge,fmSmall)
F-test with Kenward-Roger approximation; computing time: 0.19 sec.
large : Reaction ~ Days + (Days | Subject)
small : Reaction ~ 1 + (Days | Subject)
        stat    ndf    ddf F.scaling   p.value    
Ftest 45.843  1.000 17.000         1 3.268e-06 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
> 
> ## The same test using a restriction matrix
> L <- cbind(0,1)
> KRmodcomp(fmLarge, L)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
pbkrtest
 --- call from context --- 
.is.lmm(m2)
 --- call from argument --- 
if (class(object) %in% c("matrix", "Matrix")) {
    FALSE
} else {
    lme4::isLMM(object)
}
 --- R stacktrace ---
where 1: .is.lmm(m2)
where 2: KRmodcomp_init.lmerMod(largeModel, smallModel, matrixOK = TRUE)
where 3: KRmodcomp_init(largeModel, smallModel, matrixOK = TRUE)
where 4: KRmodcomp.lmerMod(fmLarge, L)
where 5: KRmodcomp(fmLarge, L)

 --- value of length: 2 type: logical ---
[1]  TRUE FALSE
 --- function from context --- 
function (object) 
{
    if (class(object) %in% c("matrix", "Matrix")) {
        FALSE
    }
    else {
        lme4::isLMM(object)
    }
}
<bytecode: 0x40fd390>
<environment: namespace:pbkrtest>
 --- function search by body ---
Function .is.lmm in namespace pbkrtest has this body.
 ----------- END OF FAILURE REPORT -------------- 
Error in if (class(object) %in% c("matrix", "Matrix")) { : 
  the condition has length > 1
Calls: KRmodcomp ... KRmodcomp_init -> KRmodcomp_init.lmerMod -> .is.lmm
Execution halted