ComeçarComece de graça

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.

Este exercício faz parte do curso

Programming with dplyr

Ver curso

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

# Fertility vs. infant mortality rate, colors by continent
scatter <- ggplot(___, 
                  aes(x = infant_mortality_rate, 
                      y = ___)) +
             ___(aes(color = ___))
scatter
Editar e executar o código