# NOT RUN {
if(requireNamespace("ggplot2")) {
library(ggplot2)
# `color` represents a variable here
with(diamonds,
rplot(x = carat, y = price, color = color)
)
# `color` represents an actual color vector
with(diamonds,
rplot(x = carat, y = price, color = fire_map)
)
}
# }
Run the code above in your browser using DataLab