rule2Table | R Documentation |
internal function
rule2Table(ruleExec, X, target)
ruleExec |
|
X |
|
target |
a matrix of indicators matching each rule condition and each row of data
##---- 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)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.