Learn R Programming

OlinkAnalyze (version 4.2.0)

olink_color_discrete: Olink color scale for discrete ggplots

Description

Olink color scale for discrete ggplots

Usage

olink_color_discrete(..., alpha = 1, coloroption = NULL)

Value

No return value, called for side effects

Arguments

...

Optional. Additional arguments to pass to ggplot2::discrete_scale()

alpha

transparency

coloroption

string, one or more of the following: c('red', 'orange', 'yellow', 'green', 'teal', 'turqoise', 'lightblue', 'darkblue', 'purple', 'pink')

Examples

Run this code
library(ggplot2)

ggplot(mtcars, aes(x=wt, y=mpg, color=as.factor(cyl))) +
geom_point(size = 4) +
olink_color_discrete() +
theme_bw()

ggplot(mtcars, aes(x=wt, y=mpg, color=as.factor(cyl))) +
geom_point(size = 4) +
olink_color_discrete(coloroption = c('lightblue', 'red', 'green')) +
theme_bw()

Run the code above in your browser using DataLab