Scales

  1. Choose one or two of your previous plots, and give the scales a proper name.

    Hint: Use one or more scale_...() functions.

  2. What happens if you call the same scale_...() function twice in a plot?

  3. Add an overview over all available colorblind friendly Brewer scales to your rmarkdown document.

    Hint: Insert a code chunk containing RColorBrewer::display.brewer.all(colorblindFriendly = TRUE)

  4. Choose an appealing scale for one of your plots that use the “color” or “fill” aesthetics. Apply it with scale_..._brewer("<name>", palette = "<palette>")

    Hint: Use scale_..._distiller() if you have mapped a continuous variable.

  5. Practice Markdown: Create sections, subsections, item lists, emphasized and bold text, … .

Coordinate systems

  1. Create a flipped boxplot of fuel economy by transmission type.

  2. Plot highway vs. city fuel economy with an additional geom_abline() layer. How do you set a 45° degree for the diagonal line?

  3. Try to “estimate” an approximate ratio between the two economy measures by tweaking the slope argument to geom_abline().

Theming

  1. Choose your favorite among the predefined themes.

    Hint: All start with theme_...(), but watch out for theme_set().

  2. Apply theme(legend.position = "bottom") to a plot with a color or fill legend. What happens if you then apply theme_bw()? Why?

Copyright © 2017 Kirill Müller. Licensed under CC BY-NC 4.0.