Complete the code to save the plot as a PNG file.
ggsave(filename = [1], plot = p)The filename must be a string, so it needs quotes. "p.png" is the correct filename format.
Complete the code to save the plot with a width of 6 inches.
ggsave(filename = "plot.png", plot = p, width = [1])
The width argument expects a numeric value without quotes. 6 sets the width to 6 inches.
Fix the error in the code to save the plot as a PDF file.
ggsave(filename = [1], plot = p, device = "pdf")
The filename must be a string with the correct extension. "plot.pdf" is correct.
Fill both blanks to save the plot with height 4 inches and resolution 300 dpi.
ggsave(filename = "plot.png", plot = p, height = [1], dpi = [2])
Height should be 4 inches and dpi should be 300 for good resolution.
Fill all three blanks to save the plot as a JPEG with width 5 inches and quality 90.
ggsave(filename = [1], plot = p, width = [2], quality = [3], device = "jpeg")
The filename must be a string with .jpg extension, width is 5 inches, and quality is set to 90 for good image quality.