session_grid(NULL)
a <- colorize(ursa_dummy(1),name=c("low","medium","high"),stretch="equal")
ta <- as.table(a)
ta
c('category value for "low"'=category_value(a,"low"))
res <- c('match to single char'=ursa_match(a,c("medium"))
,'match to multiple num'=ursa_match(a,c(0,category_value(a,"high")))
,'match to multiple char'=ursa_match(a,c("low","high"))
,'logical OR' = a=="low" | a=="high")
res
c(band_n(res)[1]==ta[2],band_n(res)[3]==sum(ta[c(1,3)]))
Run the code above in your browser using DataLab