What is the purpose of the labs() function in ggplot2?
A. Customizes the labels and captions of the plot
B. Adds a legend to the plot
C. Sets the size of the plot margins
D. Applies statistical transformations to the data
Answer: Option A
In ggplot2, what function is used to create a scatter plot?
A. geom_scatter()
B. scatter()
C. geom_point()
D. point()
How do you change the color of all points in a ggplot2 scatter plot to red?
A. color = "red"
B. fill = "red"
C. col = "red"
D. aes(color = "red")
In ggplot2, what is the purpose of the aes() function?
A. Adds aesthetic mappings to the plot
B. Adjusts the axis labels and titles
C. Applies statistical transformations to the data
D. Sets the color of the entire plot
What is the purpose of the ggtitle() function in ggplot2?
A. Sets the title of the entire plot
B. Adds a title to a specific layer of the plot
C. Adds a title to the legend
D. Adjusts the size of the title text

Join The Discussion