This set of R Programming Aptitude Test focuses on “ggplot2 – 2”.
1. _________ generate aesthetic mappings that describe how variables in the data.
a) aes_all
b) aes_auto
c) aes
d) aes_string
View Answer
Explanation: 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
View Answer
Explanation: 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
View Answer
Explanation: 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
View Answer
Explanation: 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
View Answer
Explanation: 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
View Answer
Explanation: 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
View Answer
Explanation: 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
View Answer
Explanation: 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
View Answer
Explanation: 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
View Answer
Explanation: The syntax for rel is rel(X) where x is a number representing the relative size.
Sanfoundry Global Education & Learning Series – R Programming Language.
Here’s the list of Best Books in R Programming Language.
If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]
- Check Information Technology Books
- Practice Programming MCQs
- Apply for Programming Internship
- Check R Programming Books