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
On Mon, 24 Nov 2003, "Wiklund, P?r" wrote:> 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 plotAnd your point is? Your code was incorrect, and now your error is detected. Why are you calling close.screen: 'close.screen' removes the specified screen definition(s). when you have not specified any? Such code produced invalid output on e.g. postscript() and pdf() devices in the past, and the error is now trapped.> 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)[...] -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595