Search notes:

R function: pdf

setwd("C:/temp")

pdf ("test.pdf")

hist(rnorm(10000, 0, 1), 20)

# It seems that messages don't go into the pdf:
message("Do messages work, too?")

hist(rnorm(10000, 0, 4), 40)

dev.off()
Github repository about-r, path: /functions/pdf.R

See also

dev_off()
Saving graphics/plots to files
Index to (some) R functions

Index