R Programming Aptitude Test focuses on “ggplot2 ”.
1. _________ generate aesthetic mappings that describe how variables in the data.
a) aes_all
b) aes_auto
c) aes
d) aes_string
Answer: c
Clarification: aes generate aesthetic mappings that describe how variables in the data. aes_auto is used for automatic aesthetic mapping.
2. Point out the correct statement?
a) update_element update contents of a theme
b) Use theme_update_element to modify a small number of elements of the current theme or use theme_set to completely override it
c) theme_bw is theme with grey background and white gridlines
d) is.rel reports whether x is a theme object
Answer: a
Clarification: update_element function is deprecated. Use %+replace% or +.gg instead.
3. ______ generate aesthetic mappings from a string.
a) aes_all
b) aes_auto
c) aes_string
d) aes_position
Answer: c
Clarification: Aesthetic mappings describe how variables in the data are mapped to visual properties (aesthetics) of geoms.
4. Which of the following is a differentiation related aesthetic?
a) aes_position
b) aes_group_order
c) aes_linetype_size_shape
d) ggorder
Answer: c
Clarification: aes_position is position related aesthetics.
5. Point out the wrong statement?
a) is.rel reports whether x is a theme object
b) is.theme reports whether x is a theme object
c) opts build a theme (or partial theme) from theme elements
d) theme_bw is theme with grey background and white gridlines
Answer: a
Clarification: is.rel reports whether x is a real object.
6. ________ modify a ggplot or theme object by adding on new components.
a) +.gg
b) -.gg
c) /.gg
d) .gg
Answer: a
Clarification: This operator allows you to add objects to a ggplot or theme object.
7. __________ create a complete ggplot appropriate to a particular data type.
a) autoplot
b) is.ggplot
c) printplot
d) qplot_ggplot
Answer: a
Clarification: autoplot uses ggplot2 to draw a particular plot for an object of a particular class in a single command.
8. Which of the following creates a new ggplot plot from a data frame?
a) qplot_ggplot
b) ggplot.data.frame
c) ggfluctuation
d) ggmissplot
Answer: b
Clarification: Default list of aesthetic mappings are displayed.
9. Which of the following draws plot on current graphics device?
a) ggmissplot
b) printplot
c) print.ggplot
d) ggfluctuation
Answer: c
Clarification: print.ggplot is also known as plot.ggplot.
10. ________ is used for relative sizing of theme elements.
a) rel
b) size
c) relative
d) timrinterval
Answer: a
Clarification: The syntax for rel is rel(X) where x is a number representing the relative size.