Exercise

Define your own theme function

In the video you saw how a lot of typing can be saved by replacing code chunks with function calls. You saw how a function is usually defined, now you will apply this knowledge in order to make your previous two theme() calls reusable.

Instructions

100 XP
  • Using your new knowledge about function definitions, create a function named theme_ilo() that encapsulates your theme settings.
  • The function body should contain both theme() calls that you would normally apply directly to a plot object: theme_minimal() + your customized theme() function.
  • Copy what you did before into this theme_ilo() function, using the theme() settings provided in the sample code.