If you only want to deal with the less than or greater than operation a cheap trick would be:
test <- function(a, b, sign) { foo <- (a*sign > b*sign); return(foo); } might have to tweak the syntax. The idea behind this is that 5>3: TRUE -5>-3: FALSE (i.e. I've multiplied both sides by sign(-1)) Hope this helps, Sachin p.s. sorry about corporate notice. --- Please consider the environment before printing this email --- Allianz - Best General Insurance Company of the Year 2010* Allianz - General Insurance Company of the Year 2009+ * Australian Banking and Finance Insurance Awards + Australia and New Zealand Insurance Industry Awards This email and any attachments has been sent by Allianz ...{{dropped:3}} ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.