[Rd] range checking

Robert King robert.king at newcastle.edu.au
Tue May 13 11:01:49 MEST 2003


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 at 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



More information about the R-devel mailing list