powered by
Remove colour mapping unless found in select mapping keys
remove_color_unless_equal(mapping, to = c("x", "y"))
Aes mapping with colour mapping kept only if found in selected mapping keys.
output of ggplot2::aes(...)
ggplot2::aes(...)
set of mapping keys to check
mapping <- aes(x = sex, y = age, colour = sex) mapping <- aes(x = sex, y = age, colour = region) remove_color_unless_equal(mapping)
Run the code above in your browser using DataLab