Learn R Programming

GGally (version 2.2.1)

remove_color_unless_equal: Remove colour mapping unless found in select mapping keys

Description

Remove colour mapping unless found in select mapping keys

Usage

remove_color_unless_equal(mapping, to = c("x", "y"))

Value

Aes mapping with colour mapping kept only if found in selected mapping keys.

Arguments

mapping

output of ggplot2::aes(...)

to

set of mapping keys to check

Examples

Run this code
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