What code chunk do you add to the third line to save your plot as a JPEG file with penguins as the file name?

Home » Data Science » Data Analysis » You are working with the penguins dataset. You create a scatterplot with the following lines of code:ggplot(data = penguins) +geom_point(mapping = aes(x = flipper_length_mm, y = body_mass_g)) +What code chunk do you add to the third line to save your plot as a png file with “penguins” as the file name?

Q:

Practice More Questions From: Visualizations Aesthetics and Annotations

What code chunk do you add to the third line to save your plot as a PNG file?

Solution. You write the code chunk ggsave(“chocolate. png”) .

What code chunk do you add to the third line to save your plot as a PDF file?

You add the code chunk ggsave(“chocolate. pdf”) to save your plot as a pdf file with “chocolate” as the file name.

What does the Geom_jitter () function do to the points in the plot?

It adds a small amount of random variation to the location of each point, and is a useful way of handling overplotting caused by discreteness in smaller datasets.

What does the alpha aesthetic do to the appearance of the points on the plot?

Like color, size, and shape, “alpha” is an aesthetic property that points (and some other plot elements) have, and to which variables can be mapped. It controls how transparent the object will appear when drawn.