"sixplot" <- function(data=coralRG$R, images=1:6, layout=coralRG$printer, FUN=slide.image, device="", nam=NULL, width=7.5, height=11){ nam <- as.character(substitute(data)) nam <- paste(nam[2], nam[3], sep=":") nch <- nchar(nam) ext <- switch(device, ps="ps", pdf="pdf", png="png", jpeg="jpg", bitmap="bmp") dev <- switch(device, ps=postscript, pdf=pdf, png=png, jpeg=jpeg, bitmap=bitmap) if(device!=""){ fname <- paste(nam,".", ext, sep="") print(fname) dev(file=fname,width=width, height=height, horiz=F) } oldpar <- par(mfrow=c(3,2), mar=c(2.6,3.6,2.6,1.6),mgp=c(1,0.25,0)) on.exit(par(oldpar)) for(i in images)FUN(data[,i], layout=layout) mtext(side=3,line=0.5, nam, outer=T) if(device!="")dev.off() }