LoslegenKostenlos loslegen

Plotting and scheming

Before you get to work with rlang to create a custom function, you'll create a scatterplot of two variables using ggplot2, coloring by another variable. As a reminder, it is common for the variables given to be listed as "y versus x", where "y" corresponds to the variable plotted on the vertical axis and "x" is on the horizontal axis.

The dplyr and ggplot2 packages, as well as the world_bank_2015 tibble, have been loaded for you for the exercises in this lesson. world_bank_2015 focuses on only the rows with year equal to 2015 in the world_bank_data tibble.

Diese Übung ist Teil des Kurses

Programming with dplyr

Kurs anzeigen

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# Fertility vs. infant mortality rate, colors by continent
scatter <- ggplot(___, 
                  aes(x = infant_mortality_rate, 
                      y = ___)) +
             ___(aes(color = ___))
scatter
Code bearbeiten und ausführen