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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: frbs-package
> ### Title: Getting started with the frbs package
> ### Aliases: frbs frbs-package
> 
> ### ** Examples
> 
> ##################################
> ## I. Regression Problem
> ## In this example, we are using the gas furnace dataset that
> ## contains two input and one output variables.
> ##################################
> 
> ## Input data: Using the Gas Furnace dataset
> ## then split the data to be training and testing datasets
> data(frbsData)
> data.train <- frbsData$GasFurnance.dt[1 : 204, ]
> data.tst <- frbsData$GasFurnance.dt[205 : 292, 1 : 2]
> real.val <- matrix(frbsData$GasFurnance.dt[205 : 292, 3], ncol = 1)
> 
> ## Define interval of data
> range.data <-apply(data.train, 2, range)
> 
> ## Set the method and its parameters,
> ## for example, we use Wang and Mendel's algorithm
> method.type <- "WM"
> control <- list(num.labels = 15, type.mf = "GAUSSIAN", type.defuz = "WAM",
+            type.tnorm = "MIN", type.snorm = "MAX", type.implication.func = "ZADEH",
+                name = "sim-0")
> 
> ## Learning step: Generate an FRBS model
> object.reg <- frbs.learn(data.train, range.data, method.type, control)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
frbs
 --- call from context --- 
frbs.learn(data.train, range.data, method.type, control)
 --- call from argument --- 
if (class(data.train) != "matrix") {
    data.train <- as.matrix(data.train)
}
 --- R stacktrace ---
where 1: frbs.learn(data.train, range.data, method.type, control)

 --- value of length: 2 type: logical ---
[1] FALSE  TRUE
 --- function from context --- 
function (data.train, range.data = NULL, method.type = c("WM"), 
    control = list()) 
{
    options(verbose = FALSE)
    method.type <- toupper(method.type)
    colnames.var <- colnames(data.train)
    mod <- NULL
    if (class(data.train) != "matrix") {
        data.train <- as.matrix(data.train)
    }
    if (is.null(range.data)) {
        if (any(method.type == c("FRBCS.W", "FRBCS.CHI", "GFS.GCCL", 
            "FH.GBML", "SLAVE"))) {
            dt.min <- matrix(do.call(pmin, lapply(1:nrow(data.train[, 
                -ncol(data.train), drop = FALSE]), function(i) data.train[i, 
                -ncol(data.train), drop = FALSE])), nrow = 1)
            dt.max <- matrix(do.call(pmax, lapply(1:nrow(data.train[, 
                -ncol(data.train), drop = FALSE]), function(i) data.train[i, 
                -ncol(data.train), drop = FALSE])), nrow = 1)
        }
        else {
            dt.min <- matrix(do.call(pmin, lapply(1:nrow(data.train), 
                function(i) data.train[i, ])), nrow = 1)
            dt.max <- matrix(do.call(pmax, lapply(1:nrow(data.train), 
                function(i) data.train[i, ])), nrow = 1)
        }
        range.data <- rbind(dt.min, dt.max)
    }
    if (any(method.type == c("WM", "HYFIS"))) {
        control <- setDefaultParametersIfMissing(control, list(num.labels = 7, 
            max.iter = 10, step.size = 0.01, type.mf = "GAUSSIAN", 
            type.defuz = "WAM", type.tnorm = "MIN", type.snorm = "MAX", 
            type.implication.func = "ZADEH", name = "sim-0"))
        range.data.ori <- range.data
        data.train.ori <- data.train
        num.labels <- control$num.labels
        type.mf <- control$type.mf
        name <- control$name
        type.tnorm <- control$type.tnorm
        type.snorm <- control$type.snorm
        type.defuz <- control$type.defuz
        type.implication.func <- control$type.implication.func
        num.labels <- matrix(rep(num.labels, ncol(range.data)), 
            nrow = 1)
        data.tra.norm <- norm.data(data.train.ori, range.data.ori, 
            min.scale = 0, max.scale = 1)
        if (method.type == "WM") {
            modelSpecific <- WM(data.tra.norm, num.labels, type.mf, 
                type.tnorm, type.implication.func)
            mod <- modelSpecific
            mod$type.model <- "MAMDANI"
            mod$func.tsk <- NULL
            mod$type.defuz <- type.defuz
            mod$type.snorm <- type.snorm
            mod$range.data.ori <- range.data.ori
        }
        else if (method.type == "HYFIS") {
            max.iter <- control$max.iter
            step.size <- control$step.size
            modelSpecific <- HyFIS(data.tra.norm, num.labels, 
                max.iter, step.size, type.tnorm, type.snorm, 
                type.defuz, type.implication.func)
            mod <- modelSpecific
            mod$range.data.ori <- range.data.ori
        }
    }
    else if (method.type == "SBC") {
        control <- setDefaultParametersIfMissing(control, list(r.a = 0.5, 
            eps.high = 0.5, eps.low = 0.15, name = "sim-0"))
        r.a <- control$r.a
        eps.high <- control$eps.high
        eps.low <- control$eps.low
        name <- control$name
        range.data.ori <- range.data
        modelSpecific <- SBC(data.train, range.data.ori, r.a, 
            eps.high, eps.low)
        mod <- modelSpecific
    }
    else if (any(method.type == c("ANFIS", "FIR.DM", "FS.HGD"))) {
        control <- setDefaultParametersIfMissing(control, list(num.labels = 7, 
            max.iter = 10, step.size = 0.01, type.tnorm = "MIN", 
            type.snorm = "MAX", type.implication.func = "ZADEH", 
            alpha.heuristic = 1, name = "sim-0"))
        range.data.ori <- range.data
        data.train.ori <- data.train
        n.labels <- control$num.labels
        max.iter <- control$max.iter
        step.size <- control$step.size
        type.tnorm <- control$type.tnorm
        type.snorm <- control$type.snorm
        type.implication.func <- control$type.implication.func
        name <- control$name
        data.tra.norm <- norm.data(data.train.ori, range.data.ori, 
            min.scale = 0, max.scale = 1)
        num.labels <- matrix(rep(n.labels, ncol(range.data.ori)), 
            nrow = 1)
        if (method.type == "ANFIS") {
            modelSpecific <- ANFIS(data.tra.norm, num.labels, 
                max.iter, step.size, type.tnorm, type.snorm, 
                type.implication.func)
        }
        else if (method.type == "FIR.DM") {
            modelSpecific <- FIR.DM(data.tra.norm, num.labels, 
                max.iter, step.size, type.tnorm, type.snorm, 
                type.implication.func)
        }
        else if (method.type == "FS.HGD") {
            alpha.heuristic <- control$alpha.heuristic
            modelSpecific <- FS.HGD(data.tra.norm, num.labels, 
                max.iter, step.size, alpha.heuristic, type.tnorm, 
                type.snorm, type.implication.func)
        }
        mod <- modelSpecific
        mod$range.data.ori <- range.data.ori
    }
    else if (any(method.type == c("FRBCS.W", "FRBCS.CHI"))) {
        control <- setDefaultParametersIfMissing(control, list(num.labels = 7, 
            type.mf = "GAUSSIAN", type.tnorm = "MIN", type.snorm = "MAX", 
            type.implication.func = "ZADEH", name = "sim-0"))
        range.data.input <- range.data
        n.labels <- control$num.labels
        num.labels <- matrix(rep(n.labels, ncol(data.train)), 
            nrow = 1)
        type.mf <- control$type.mf
        type.tnorm <- control$type.tnorm
        type.snorm <- control$type.snorm
        type.implication.func <- control$type.implication.func
        name <- control$name
        range.data.out <- matrix(c(min(data.train[, ncol(data.train)], 
            na.rm = TRUE) - 0.4999, max(data.train[, ncol(data.train)], 
            na.rm = TRUE) + 0.4999), nrow = 2)
        num.class <- floor(max(range.data.out))
        range.data.norm <- range.data.input
        range.data.norm[1, ] <- 0
        range.data.norm[2, ] <- 1
        range.data.ori <- range.data.input
        range.data.inout <- cbind(range.data.norm, range.data.out)
        data.tra.norm <- norm.data(data.train[, 1:(ncol(data.train) - 
            1)], range.data.ori, min.scale = 0, max.scale = 1)
        data.train <- cbind(data.tra.norm, matrix(data.train[, 
            ncol(data.train)], ncol = 1))
        if (method.type == "FRBCS.W") {
            modelSpecific <- FRBCS.W(range.data.inout, data.train, 
                num.labels, num.class, type.mf, type.tnorm, type.snorm, 
                type.implication.func)
        }
        else if (method.type == "FRBCS.CHI") {
            modelSpecific <- FRBCS.CHI(range.data.inout, data.train, 
                num.labels, num.class, type.mf, type.tnorm, type.snorm, 
                type.implication.func)
        }
        mod <- modelSpecific
        mod$range.data.ori <- range.data.ori
    }
    else if (method.type == "DENFIS") {
        control <- setDefaultParametersIfMissing(control, list(Dthr = 0.1, 
            max.iter = 100, step.size = 0.01, d = 2, name = "sim-0"))
        Dthr <- control$Dthr
        max.iter <- control$max.iter
        step.size <- control$step.size
        d <- control$d
        name <- control$name
        range.data.ori <- range.data
        modelSpecific <- DENFIS(data.train, range.data.ori, Dthr, 
            max.iter, step.size, d)
        mod <- modelSpecific
    }
    else if (method.type == "GFS.FR.MOGUL") {
        control <- setDefaultParametersIfMissing(control, list(persen_cross = 0.6, 
            max.iter = 10, max.gen = 10, max.tune = 10, persen_mutant = 0.3, 
            epsilon = 0.8, name = "sim-0"))
        range.data.ori <- range.data
        data.train.ori <- data.train
        persen_cross <- control$persen_cross
        persen_mutant <- control$persen_mutant
        max.iter <- control$max.iter
        max.gen <- control$max.gen
        max.tune <- control$max.tune
        epsilon <- control$epsilon
        name <- control$name
        data.tra.norm <- norm.data(data.train.ori, range.data.ori, 
            min.scale = 0, max.scale = 1)
        modelSpecific <- GFS.FR.MOGUL(data.tra.norm, persen_cross, 
            persen_mutant, max.iter, max.gen, max.tune, range.data.ori, 
            epsilon)
        mod <- modelSpecific
    }
    else if (method.type == "GFS.THRIFT") {
        control <- setDefaultParametersIfMissing(control, list(popu.size = 10, 
            num.labels = 3, persen_cross = 0.6, max.gen = 10, 
            persen_mutant = 0.3, type.defuz = "WAM", type.tnorm = "MIN", 
            type.snorm = "MAX", type.mf = "TRIANGLE", type.implication.func = "ZADEH", 
            name = "sim-0"))
        range.data.ori <- range.data
        data.train.ori <- data.train
        popu.size <- control$popu.size
        persen_cross <- control$persen_cross
        persen_mutant <- control$persen_mutant
        max.gen <- control$max.gen
        name <- control$name
        n.labels <- control$num.labels
        type.defuz <- control$type.defuz
        type.tnorm <- control$type.tnorm
        type.snorm <- control$type.snorm
        type.mf <- control$type.mf
        type.implication.func <- control$type.implication.func
        data.tra.norm <- norm.data(data.train.ori, range.data.ori, 
            min.scale = 0, max.scale = 1)
        num.labels <- matrix(rep(n.labels, ncol(range.data.ori)), 
            nrow = 1)
        modelSpecific <- GFS.Thrift(data.tra.norm, popu.size, 
            num.labels, persen_cross, persen_mutant, max.gen, 
            range.data.ori, type.defuz, type.tnorm, type.snorm, 
            type.mf, type.implication.func)
        mod <- modelSpecific
    }
    else if (method.type == "GFS.GCCL") {
        control <- setDefaultParametersIfMissing(control, list(popu.size = 10, 
            num.class = 2, num.labels = 3, persen_cross = 0.6, 
            max.gen = 10, persen_mutant = 0.3, name = "sim-0"))
        range.data.input <- range.data
        data.train.ori <- data.train
        popu.size <- control$popu.size
        persen_cross <- control$persen_cross
        persen_mutant <- control$persen_mutant
        max.gen <- control$max.gen
        name <- control$name
        n.labels <- control$num.labels
        n.class <- control$num.class
        num.labels <- matrix(rep(n.labels, ncol(range.data)), 
            nrow = 1)
        num.labels <- cbind(num.labels, n.class)
        range.data.norm <- range.data.input
        range.data.norm[1, ] <- 0
        range.data.norm[2, ] <- 1
        range.data.input.ori <- range.data.input
        data.tra.norm <- norm.data(data.train[, 1:ncol(data.train) - 
            1], range.data.input, min.scale = 0, max.scale = 1)
        data.train <- cbind(data.tra.norm, matrix(data.train[, 
            ncol(data.train)], ncol = 1))
        modelSpecific <- GFS.GCCL(data.train, popu.size, range.data.norm, 
            num.labels, persen_cross, persen_mutant, max.gen, 
            range.data.input.ori)
        mod <- modelSpecific
    }
    else if (method.type == "FH.GBML") {
        control <- setDefaultParametersIfMissing(control, list(popu.size = 10, 
            max.num.rule = 5, num.class = 3, persen_cross = 0.6, 
            max.gen = 10, persen_mutant = 0.3, p.dcare = 0.5, 
            p.gccl = 0.5, name = "sim-0"))
        range.data.input <- range.data
        data.train.ori <- data.train
        popu.size <- control$popu.size
        persen_cross <- control$persen_cross
        persen_mutant <- control$persen_mutant
        max.gen <- control$max.gen
        name <- control$name
        num.class <- control$num.class
        max.num.rule <- control$max.num.rule
        p.dcare <- control$p.dcare
        p.gccl <- control$p.gccl
        data.tra.norm <- norm.data(data.train.ori[, -ncol(data.train.ori), 
            drop = FALSE], range.data.input, min.scale = 0, max.scale = 1)
        data.tra.norm <- cbind(data.tra.norm, data.train.ori[, 
            ncol(data.train.ori), drop = FALSE])
        modelSpecific <- FH.GBML(data.tra.norm, popu.size, max.num.rule, 
            persen_cross, persen_mutant, max.gen, num.class, 
            range.data.input, p.dcare, p.gccl)
        mod <- modelSpecific
    }
    else if (method.type == "SLAVE") {
        control <- setDefaultParametersIfMissing(control, list(num.class = 3, 
            num.labels = 3, persen_cross = 0.6, max.iter = 10, 
            max.gen = 10, persen_mutant = 0.3, k.lower = 0, k.upper = 1, 
            epsilon = 0.5, name = "sim-0"))
        range.data.input <- range.data
        data.train.ori <- data.train
        persen_cross <- control$persen_cross
        persen_mutant <- control$persen_mutant
        max.iter <- control$max.iter
        max.gen <- control$max.gen
        name <- control$name
        num.class <- control$num.class
        num.labels <- control$num.labels
        k.lower <- control$k.lower
        k.upper <- control$k.upper
        epsilon <- control$epsilon
        num.labels <- matrix(rep(num.labels, ncol(range.data)), 
            nrow = 1)
        num.labels <- cbind(num.labels, num.class)
        data.tra.norm <- norm.data(data.train.ori[, -ncol(data.train.ori), 
            drop = FALSE], range.data.input, min.scale = 0, max.scale = 1)
        data.tra.norm <- cbind(data.tra.norm, data.train.ori[, 
            ncol(data.train.ori), drop = FALSE])
        modelSpecific <- SLAVE(data.tra.norm, persen_cross, persen_mutant, 
            max.iter, max.gen, num.labels, range.data.input, 
            k.lower, k.upper, epsilon)
        mod <- modelSpecific
    }
    else if (method.type == "GFS.LT.RS") {
        control <- setDefaultParametersIfMissing(control, list(popu.size = 10, 
            num.labels = 3, persen_mutant = 0.3, max.gen = 10, 
            mode.tuning = "GLOBAL", type.tnorm = "MIN", type.snorm = "MAX", 
            type.defuz = "WAM", type.implication.func = "ZADEH", 
            rule.selection = TRUE, name = "sim-0"))
        range.data.ori <- range.data
        data.train.ori <- data.train
        popu.size <- control$popu.size
        persen_mutant <- control$persen_mutant
        max.gen <- control$max.gen
        name <- control$name
        n.labels <- control$num.labels
        mode.tuning <- control$mode.tuning
        rule.selection <- control$rule.selection
        type.tnorm <- control$type.tnorm
        type.snorm <- control$type.snorm
        type.implication.func <- control$type.implication.func
        type.defuz <- control$type.defuz
        num.labels <- matrix(rep(n.labels, ncol(range.data)), 
            nrow = 1)
        range.data.norm <- range.data
        range.data.norm[1, ] <- 0
        range.data.norm[2, ] <- n.labels - 1
        data.tra.norm <- norm.data(data.train, range.data.ori, 
            min.scale = 0, max.scale = (n.labels - 1))
        modelSpecific <- GFS.LT.RS(data.tra.norm, popu.size, 
            range.data.norm, num.labels, persen_mutant, max.gen, 
            mode.tuning, type.tnorm, type.snorm, type.implication.func, 
            type.defuz, rule.selection, range.data.ori)
        mod <- modelSpecific
    }
    mod$method.type <- method.type
    mod$name <- name
    mod <- convert.params(mod)
    if (!is.null(colnames.var)) {
        mod$colnames.var <- colnames.var
    }
    else {
        mod$colnames.var <- paste("var", seq(1, ncol(data.train)), 
            sep = ".")
    }
    mod <- frbsObjectFactory(mod)
    if (!is.null(mod$rule) && !is.null(mod$num.labels)) 
        mod$rule <- rep.rule(mod)
    return(mod)
}
<bytecode: 0x1860df8>
<environment: namespace:frbs>
 --- function search by body ---
Function frbs.learn in namespace frbs has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1