if(interactive() || Sys.getenv("USER") == "maechler"
) {
myPS <- tempfile("ex", fileext = ".ps")
ps.do(myPS)
data(sunspots)
plot(sunspots)
ps.end()
tempfile("ex-sun", fileext = ".pdf") -> myPDF
pdf.latex(myPDF)
plot(sunspots)
pdf.end(call. = FALSE) # basically the same as dev.off()
}
ps.latex(tempfile("ex2", fileext = ".eps"))
plot(sunspots)
ps.end(call.gv = FALSE) # basically the same as dev.off()
Run the code above in your browser using DataLab