From robert.king at newcastle.edu.au  Tue May 13 11:01:49 2003
From: robert.king at newcastle.edu.au (Robert King)
Date: Tue May 13 02:01:10 2003
Subject: [Rd] range checking
Message-ID: <Pine.LNX.4.21.0305130955360.14452-100000@tolstoy.newcastle.edu.au>

I'm tidying up the gld package at the moment, and the following is my best
effort at checking if values are outside the range of the function
(which is [0,1] in this case).  

It seems incredibly messy - is there something better?

outside.range <- !as.logical(((p<1)*(p>0))|(sapply(p,
all.equal,1)=="TRUE")|(sapply(p, all.equal, 0)=="TRUE"))

----
Robert King, Statistics, School of Mathematical & Physical Sciences,
University of Newcastle, Australia
Room V133  ph +61 2 4921 5548
Robert.King@newcastle.edu.au   http://maths.newcastle.edu.au/~rking/

"It's easy to lie with statistics.  It's even easier to lie without them."
	-- Frederick Mosteller


[Rd] range checking
Robert King