##---- 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 (tag, toProcess)
{
regexp <- "(\w+)\s*([!><=]+)\s*(\d+)"
conditional <- unlist(strapply(tag, regexp, c))
if (length(conditional) < 3) {
stop("Error in conditional tag: does not contain variable, operator, and value. Tag = ",
tag)
}
if (conditional[2] == "=")
conditional[2] = "=="
iteratorPosition <- grep(paste("\b", conditional[1], "\b",
sep = ""), toProcess$iterators, perl = T)
return(eval(parse(text = paste("toProcess$curItPos[iteratorPosition]",
conditional[2], conditional[3], sep = ""))))
}
Run the code above in your browser using DataLab