Olink fill scale for discrete ggplots
olink_fill_discrete(..., alpha = 1, coloroption = NULL)
No return value, called for side effects
Optional. Additional arguments to pass to ggplot2::discrete_scale()
transparency (optional)
string, one or more of the following: c('red', 'orange', 'yellow', 'green', 'teal', 'turqoise', 'lightblue', 'darkblue', 'purple', 'pink')
library(ggplot2)
dsub <- subset(diamonds, x > 5 & x < 6 & y > 5 & y < 6)
dsub$diff <- with(dsub, sqrt(abs(x-y))* sign(x-y))
ggplot(dsub, aes(x, y, colour=diff)) +
geom_point() +
theme_bw() +
olink_fill_discrete()
Run the code above in your browser using DataLab