Aan de slagGa gratis aan de slag

Adding a title to your graph

There are many other options for customizing a ggplot2 graph, which you can learn about in other DataCamp courses. You can also learn about them from online resources, which is an important skill to develop.

As the final exercise in this course, you'll practice looking up ggplot2 instructions by completing a task we haven't shown you how to do.

Deze oefening maakt deel uit van de cursus

Introduction to the Tidyverse

Cursus bekijken

Oefeninstructies

  • Add a title to the graph: Comparing GDP per capita across continents. Use a search engine, such as Google or Bing, to learn how to do so.
  • After this exercise you are almost done with your course. If you enjoyed the material, feel free to send Dave a thank you via twitter. He'll appreciate it. Tweet to Dave

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

library(gapminder)
library(dplyr)
library(ggplot2)

gapminder_1952 <- gapminder %>%
  filter(year == 1952)

# Add a title to this graph: "Comparing GDP per capita across continents"
ggplot(gapminder_1952, aes(x = continent, y = gdpPercap)) +
  geom_boxplot() +
  scale_y_log10()
Code bewerken en uitvoeren