[Desire-commits] r25 - packages/desire/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat May 31 00:21:14 CEST 2008


Author: olafm
Date: 2008-05-31 00:21:14 +0200 (Sat, 31 May 2008)
New Revision: 25

Modified:
   packages/desire/R/harrington2.R
Log:
* FIX: Replace uniroot with optimize to avoid bad input to pharrington2()


Modified: packages/desire/R/harrington2.R
===================================================================
--- packages/desire/R/harrington2.R	2008-05-30 22:20:11 UTC (rev 24)
+++ packages/desire/R/harrington2.R	2008-05-30 22:21:14 UTC (rev 25)
@@ -95,7 +95,7 @@
   f <- function(q) 
     (p - pharrington2(q, LSL, USL, n, mean, sd))^2
   ## FIXME: Ugly search
-  uniroot(f, c(-Inf, Inf))$root
+  optimize(f, c(0, 1))$minimum1
 }
 
 qdesire.harrington2 <- function(p, f, mean, sd) {



More information about the Desire-commits mailing list