View source: R/singleRuleList2Exec.R
singleRuleList2Exec | R Documentation |
internal
singleRuleList2Exec(ruleList, typeX)
ruleList |
|
typeX |
data frame containing rule conditions
##---- 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 (ruleList, typeX)
{
ruleExec <- ""
vars <- ls(ruleList)
vars <- vars[order(as.numeric(vars))]
for (i in 1:length(vars)) {
if (typeX[as.numeric(vars[i])] == 2) {
values <- paste("c(", paste(paste("'", ruleList[[vars[i]]],
"'", sep = ""), collapse = ","), ")", sep = "")
tmp = paste("X[,", vars[i], "] %in% ", values, sep = "")
}
else {
tmp = ruleList[[vars[i]]]
}
if (i == 1)
ruleExec <- paste(ruleExec, tmp, sep = "")
if (i > 1)
ruleExec <- paste(ruleExec, " & ", tmp, sep = "")
}
return(c(ruleExec))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.