adplus-dvertising
frame-decoration

Question

If I want to save a plot to a PDF file, which of the following is a correct way of doing that?

a.

Construct the plot on the screen device and then copy it to a PDF file with dev.copy2pdf()

b.

Construct the plot on the PNG device with png(), then copy it to a PDF with dev.copy2pdf()

c.

Open the PostScript device with postscript(), construct the plot, then close the device with dev.off()

d.

Open the screen device with quartz(), construct the plot, and then close the device with dev.off()

Posted under R Programming

Answer: (a).Construct the plot on the screen device and then copy it to a PDF file with dev.copy2pdf()

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. If I want to save a plot to a PDF file, which of the following is a correct way of doing that?