rule2Table: internal function

View source: R/rule2Table.R

rule2TableR Documentation

internal function

Description

internal function

Usage

rule2Table(ruleExec, X, target)

Arguments

ruleExec
X
target

Value

a matrix of indicators matching each rule condition and each row of data

Examples

##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (ruleExec, X, target) 
{
    I <- rep(0, nrow(X))
    ruleExec <- paste("which(", ruleExec, ")")
    ixMatch <- eval(parse(text = ruleExec))
    if (length(ixMatch) > 0) 
        I[ixMatch] <- 1
    names(I) = NULL
    return(I)
  }

inTrees documentation built on June 1, 2022, 1:06 a.m.

Related to rule2Table in inTrees...