R/lookupRule.R

Defines functions lookupRule

Documented in lookupRule

lookupRule <-
function(rules,strList){
  ix <- grep(strList[1], rules[,"condition"],fixed = TRUE)
  if(length(strList)>=2){
    for(i in 2:length(strList)){
      ix2 <- grep(strList[i], rules[,"condition"],fixed = TRUE)
      ix <- intersect(ix,ix2)
    }
  }
  if(length(ix)>=1)return(rules[ix,,drop=FALSE])
  if(length(ix)==0)return(NULL) 
}

Try the inTrees package in your browser

Any scripts or data that you put into this service are public.

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