/working/auteur/R/withinrange.R
http://github.com/eastman/auteur · R · 10 lines · 6 code · 2 blank · 2 comment · 2 complexity · bbe63be7f8059b6d8d3f139e5db95c61 MD5 · raw file
- #determines if a value falls within a range [min,max]
- #author: JM Eastman 2010
- withinrange <-
- function(x, min, max) {
- a=sign(x-min)
- b=sign(x-max)
- if(abs(a+b)==2) return(FALSE) else return(TRUE)
- }