Running examples in ‘phtt-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: KSS
> ### Title: KSS-Routine
> ### Aliases: KSS KSS.default
> 
> ### ** Examples
> 
> ## See the example in 'help(Cigar)' in order to take a look at the
> ## data set Cigar
> 
> ##########
> ## DATA ##
> ##########
> 
> data(Cigar)
> ## Panel-Dimensions:
> N <- 46
> T <- 30
> ## Dependent variable:
>   ## Cigarette-Sales per Capita
>   l.Consumption    <- log(matrix(Cigar$sales, T,N))
> ## Independent variables:
>   ## Consumer Price Index
>   cpi        <- matrix(Cigar$cpi, T,N)
>   ## Real Price per Pack of Cigarettes 
>   l.Price  <- log(matrix(Cigar$price, T,N)/cpi)
>   ## Real Disposable Income per Capita  
>   l.Income    <- log(matrix(Cigar$ndi,   T,N)/cpi)
> 
> ## Estimation:
> KSS.fit      <- KSS(l.Consumption~l.Price+l.Income, CV=TRUE)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
phtt
 --- call from context --- 
OptDim.default(Obj = Residu.mat, criteria = "KSS.C", spar = spar.dim.fit)
 --- call from argument --- 
if (class(Obj) == "KSS" | class(Obj) == "Eup") Obj <- Obj$unob.fact.stru + 
    Obj$residuals else is.regular.panel(Obj, stopper = TRUE)
 --- R stacktrace ---
where 1: OptDim.default(Obj = Residu.mat, criteria = "KSS.C", spar = spar.dim.fit)
where 2: OptDim(Obj = Residu.mat, criteria = "KSS.C", spar = spar.dim.fit)
where 3: KSS.CV(kappa.interv = c(.Machine$double.eps, spar.interval.max), 
    Y = TR.Y, X = TR.X, N = N, T = T, P = P, spar.dim.fit = spar.low, 
    tol = convergence)
where 4: KSS.default(l.Consumption ~ l.Price + l.Income, CV = TRUE)
where 5: KSS(l.Consumption ~ l.Price + l.Income, CV = TRUE)

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (Obj, criteria = c("PC1", "PC2", "PC3", "BIC3", "IC1", 
    "IC2", "IC3", "IPC1", "IPC2", "IPC3", "ABC.IC1", "ABC.IC2", 
    "KSS.C", "ED", "ER", "GR"), standardize = FALSE, d.max, sig2.hat, 
    spar, level = 0.01, c.grid = seq(0, 5, length.out = 128), 
    T.seq, n.seq) 
{
    if (class(Obj) == "KSS" | class(Obj) == "Eup") 
        Obj <- Obj$unob.fact.stru + Obj$residuals
    else is.regular.panel(Obj, stopper = TRUE)
    if (missing(d.max)) 
        d.max <- NULL
    if (missing(sig2.hat)) 
        sig2.hat <- NULL
    if (missing(spar)) 
        spar <- NULL
    if (missing(c.grid)) 
        c.grid <- NULL
    if (missing(T.seq)) 
        T.seq <- NULL
    if (missing(n.seq)) 
        n.seq <- NULL
    if (standardize) 
        Obj <- standardize(Obj)
    criteria <- match.arg(criteria, several.ok = TRUE)
    checkBai <- criteria %in% c("PC1", "PC2", "PC3", "BIC3", 
        "IC1", "IC2", "IC3", "IPC1", "IPC2", "IPC3", "Eup.PC1", 
        "Eup.IPC1")
    if (any(checkBai)) {
        BaiS <- try(B.OptDim(Obj, criteria = criteria[checkBai], 
            d.max = d.max, sig2.hat = sig2.hat))
    }
    checkOnat <- criteria %in% c("ED")
    if (any(checkOnat)) {
        OnatS <- try(O.OptDim(Obj, d.max = d.max))
    }
    checkRH <- criteria %in% c("ER", "GR")
    if (any(checkRH)) {
        RHS <- try(RH.OptDim(Obj, criteria = criteria[checkRH], 
            d.max = d.max))
    }
    checkKSS <- criteria %in% c("KSS.C")
    if (any(checkKSS)) {
        KSSS <- try(KSS.OptDim(Obj, criteria = c("KSS.C"), sig2.hat = sig2.hat, 
            alpha = level, factor.dim = NULL, d.max = d.max, 
            spar = spar)[[1]])
    }
    checkABC <- criteria %in% c("ABC.IC1", "ABC.IC2", "DCPC")
    if (any(checkABC)) {
        ABCS <- try(abc.OptDim(Obj, criteria = criteria[checkABC], 
            c.grid = c.grid, n.seq = n.seq, T.seq = T.seq, d.max = d.max))
    }
    ll <- length(criteria)
    Result <- vector(mode = "list", ll)
    for (l in 1:ll) {
        if (checkBai[l]) 
            Result[[l]] <- BaiS[BaiS[, 1] == criteria[l], ]
        else {
            if (checkOnat[l]) 
                Result[[l]] <- OnatS
            else {
                if (checkRH[l]) 
                  Result[[l]] <- RHS[RHS[, 1] == criteria[l], 
                    ]
                else {
                  if (checkKSS[l]) 
                    Result[[l]] <- KSSS
                  else {
                    if (checkABC[l]) 
                      Result[[l]] <- ABCS[ABCS[, 1] == criteria[l], 
                        ]
                  }
                }
            }
        }
    }
    summary <- sapply(1:length(criteria), function(l) Result[[l]][, 
        1:2])
    Summary <- matrix(as.numeric(summary[2, ]), ncol(summary))
    colnames(Summary) <- " "
    rownames(Summary) <- summary[1, ]
    Summary <- t(Summary)
    Result$summary <- Summary
    Result$criteria <- criteria
    Result$BaiNgC <- criteria %in% c("PC1", "PC2", "PC3", "BIC3", 
        "IC1", "IC2", "IC3")
    Result$BaiC <- criteria %in% c("IPC1", "IPC2", "IPC3")
    Result$KSSC <- checkKSS
    Result$OnatC <- checkOnat
    Result$RHC <- checkRH
    Result$EupC <- criteria %in% c("Eup.PC1", "Eup.IPC1")
    Result$ABCC <- criteria %in% c("ABC.IC1", "ABC.IC2")
    Result$BadaC <- criteria %in% c("DCPC")
    Result$cl <- match.call()
    Result$obj <- Obj
    structure(Result, class = "OptDim")
}
<bytecode: 0x5616dcdaaa78>
<environment: namespace:phtt>
 --- function search by body ---
Function OptDim.default in namespace phtt has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1