[Rd] rpart:plotcp doesn't allow ylim argument (PR#1171)

gregory_r_warnes@groton.pfizer.com gregory_r_warnes@groton.pfizer.com
Wed, 14 Nov 2001 21:20:34 +0100 (MET)


Full_Name: Gregory R. Warnes
Version: R 1.3.1
OS: Solaris 2.8
Submission from: (NULL) (192.77.198.200)


rpart library version 3.1-2

Error message:
> plotcp(fit.thirds.1,ylim=c(0.7,1.5));
Error in plot.default(ns, xerror, axes = FALSE, xlab = "cp", ylab = "X-val
Relative Error",  : 
	formal argument "ylim" matched by multiple actual arguments
> 

This can be corrected by adding  ylim to the list of formal argument and
wrapping 
the definition of ylim with 'if(missing(ylim))'.  Patch below.

-Greg

---PATCH STARTS HERE---
diff -r rpart.orig//R/plotcp.s rpart/R/plotcp.s
5c5
< 		   upper=c("size", "splits", "none"), ...)
---
> 		   upper=c("size", "splits", "none"), ylim, ...)
18c18,19
<   ylim <- c(min(xerror - xstd) - 0.1, max(xerror + xstd) + 0.1)
---
>   if(missing(ylim))
>     ylim <- c(min(xerror - xstd) - 0.1, max(xerror + xstd) + 0.1)


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._