I have written some plot methods that I want to do automated unit tests on in R with
file: a character string giving the name of the file. If it is of the form "|cmd", the output is piped to the command given by cmd. If it is NULL, then no external file is created (effectively, no drawing occurs), but the device may still be queried (e.g., for size of text).
pdf(file = NULL) plot(1) dev.off()
doesn't produce any output.