File: ablineclip.R

package info (click to toggle)
r-cran-plotrix 3.2-6-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,136 kB
  • sloc: makefile: 3
file content (16 lines) | stat: -rwxr-xr-x 498 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
ablineclip<-function(a=NULL,b=NULL,h=NULL,v=NULL,reg=NULL, 
 coef=NULL,untf=FALSE,x1=NULL,x2=NULL,y1=NULL,y2=NULL,...) {

 if(!is.null(c(x1,x2,y1,y2))) {
  oldclip<-par("usr")
  if(is.null(x1)) x1<-oldclip[1]
  if(is.null(x2)) x2<-oldclip[2]
  if(is.null(y1)) y1<-oldclip[3]
  if(is.null(y2)) y2<-oldclip[4]
  clip(x1,x2,y1,y2)
  abline(h=oldclip[4]+1)
  clip(x1,x2,y1,y2)
 }
 abline(a=a,b=b,h=h,v=v,reg=reg,coef=coef,untf=untf,...)
 if(!is.null(c(x1,x2,y1,y2))) do.call("clip",as.list(oldclip))
}