Wraps pdf. If the file already exists, it will not be overwritten. A message will be printed indicating whether the file was successfully written or if it already existed.

pdf_safely(file = stop("'file' must be specified"), ...)

Arguments

file

Path/file name to for PDF file. Required.

...

Optional. Passed on to pdf.

Value

None.

Examples

if (FALSE) {
pdf_safely(file = "graphs.pdf")
# ... code that generates plots ...
dev.off()
}