[R] Warning calling par

"Wiklund, Pär" Par.Wiklund at ap1.se
Mon Nov 24 15:32:24 CET 2003


Hi. I have a function that works well under R 1.7.1 But under 1.8.0 and 1.8.1 I get:Warning message: 
calling par(new=) with no plot

And it doesnt plot

The function is:
mplotmeth1<-function(data1,data2,alpha,nr){
	psfile<-paste("Meth1_",nr[1],"-",nr[length(nr)],".ps",sep="")
	postscript(psfile)
	close.screen(all=T)
	par(mex=0.73,cex=0.8)
	split.screen(c(2,2))
	tq<-sort(runif(length(data1)))
	message<-rep("no message",4)
	for (i in 1:length(nr)){
		diffmethod<-paste("du.",nr[i],sep="")
		title<-paste("Family",nr[i])
		alphavalue<-paste("a=",round(alpha[i],digits=3),sep="")
		screen(i)
		data3<-sort(eval(call(diffmethod,data1,data2,alpha[i])))
		diffdata<-data3[!is.na(data3)]
		if(length(data3)>length(diffdata)){
			message[i]<-paste("Family ",nr[i],"contains NA!")
		}
		tq<-((1:length(diffdata))/(length(diffdata)+1))
		plot(diffdata,tq,xlab="C1[F(x),G(y)]",ylab="U(0,1)",type="l")
		mtext(title,line=0.7,cex=1.2)
		legend(0.5,0.3,alphavalue)
		abline(0,1)
	}
	dev.off()
	message
}

Best regards

P. Wiklund




More information about the R-help mailing list